Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualParadigm Shifter

Posted 26 April 2013 - 10:02 AM

It doesn't... but what it does do (EDIT: by default) is align 32 bit ints on a 4 byte boundary, and 16 bit ints on a 2 byte boundary. So there is 2 bytes wasted after you have 2 bytes followed by an int.

 

You get the best packing in classes and structs by having the largest members first in the struct/class. Changing the order shouldn't require changes to any client code.


#1Paradigm Shifter

Posted 26 April 2013 - 10:01 AM

It doesn't... but what it does do is align 32 bit ints on a 4 byte boundary, and 16 bit ints on a 2 byte boundary. So there is 2 bytes wasted after you have 2 bytes followed by an int.

 

You get the best packing in classes and structs by having the largest members first in the struct/class. Changing the order shouldn't require changes to any client code.


PARTNERS