Gale Paeper wrote:
Adriaan van Os wrote:
It works great, for example the following data structure
How does it work for a mixture of alignments and with single (32 bit) and double (64 bit) floating point thrown into mixture?
On Mac OS X, the maximum alignment seems to be 32-bits, not 64-bits. So the size in bytes of a "record a: single; b: double end;" on the platform is 12 bytes with any alignment.
Also, it would be a good idea to test more than just record sizes in a single code block. Things like actual field offsets and composite types with a mixture of alignments composed through uses clauses and import specifications should be part of the tests. In other words, stress tests to ensure there are no surprises/bugs in the implementation for all the various ways it might be used in general use.
Well, if you want to write the test programs (preferably useable on all platforms), they could be added to the gpc testsuite.
Regards,
Adriaan van Os