Reply to post: Re: Ugh!

Keen to go _ExtInt? LLVM Clang compiler adds support for custom width integers

Dan 55 Silver badge

Re: Ugh!

In that case it would be impossible to have bit flags packed together or have a short followed by an int without a two-byte space between them, and you can, and I do. I turn off alignment with #pragma pack.

The resultant code generated by the compiler to access this structure is obviously more complicated, but don't care because I haven't claimed there are going to be performance gains because they aren't any.

It is good for using less memory space (where did you get the idea non-aligned structures doesn't use less memory space?) which is in turn good for reading/writing records from binary files and good for sending binary data across a network yet the source code is kept relatively simple. The object code is more complicated, but as I'm not writing assembly language I don't care about that.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2022