Alignment
rokicki
Posts: 1,000
How do I enforce alignment? I want to allocate a byte buffer in spin (and use that byte buffer
in spin for a lot of things), but that byte buffer must be longword aligned.
How can I guarantee this? If it is the first var in a object, will that guarantee the alignment?
Or is there some other way?
I would just declare it as a long array, but I use it as an array in Spin all over the place and it's
very messy to do all the indexing myself.
in spin for a lot of things), but that byte buffer must be longword aligned.
How can I guarantee this? If it is the first var in a object, will that guarantee the alignment?
Or is there some other way?
I would just declare it as a long array, but I use it as an array in Spin all over the place and it's
very messy to do all the indexing myself.
Comments
This alignment is done within the scope of each object, you do not need to do your word variable counting for any other objects.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.