You are not logged in.
Pages: 1
I noticed that, if a struct doesn't have variables for which, sizeof() for all of them summed up is a multiple of 4 in my case, the difference of memory is automatically filled . So I searched about this and found that the padding at the end of the structure is used to to preserve alignment for the information. I also found that some machines cannot perform unaligned accesses at all and I was wondering "why all these?".
Thank you
Last edited by knob (2009-07-11 21:29:27)
Offline
Google's I'm feeling lucky result for "structures padding C":
http://www.openasthra.com/embedded-syst … explained/
Basically, padded data is faster to access due to architectural specifics of processors, aligned data can be accessed faster.
Offline
Google's I'm feeling lucky result for "structures padding C":
http://www.openasthra.com/embedded-syst … explained/Basically, padded data is faster to access due to architectural specifics of processors, aligned data can be accessed faster.
Using memory to fill in the gaps therefor faster access over more memory and normal access is better?
I mean, when working with large amounts of data isn't it better to have more memory? Is the speed of access distinguishable?
Last edited by knob (2009-07-11 21:59:52)
Offline
http://www.ibm.com/developerworks/library/pa-dalign/
Here, found a better source with a lot of focus on the performance issue, studying it myself right now.
Offline
Pages: 1