• Advertisement

Archived

This topic is now archived and is closed to further replies.

align something or other...

This topic is 5694 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

if I said I needed to align a variable to some boundary in C / C++ would that make sense to anyone??

Share this post


Link to post
Share on other sites
Advertisement
Should have been a bit clearer..sorry...

Yeah.what does that mean??

Share this post


Link to post
Share on other sites
That you''re aligning the variable to some boundary. Usually either a word or double word boundary. This can improve the retrieval time on certain processors, as some processors can only access memory on some boundary. For example, if I remember right the 386 processors can only access memory on 4 byte boundaries. So if you try to access a variable on a 386 that crosses this boundary the CPU may have to retrieve two separate double words, then do some swapping to get everything back in the right order. Of course this would be slower than a single access.

Share this post


Link to post
Share on other sites
Thanks for the reply...I was pretty sure thats what it was, but couldn''t find any info on it..

Thanks again

Share this post


Link to post
Share on other sites

  • Advertisement