
Simple concept for chunk-layout of heterogeneous members with proper data alignment.
A 'malloc'ed chunk of memory is always suitable to hold any data type, or array of data types (do a 'man malloc').

        unsigned char * chunk = malloc( chunk_size );

If a 'double' is to occupy a portion of the chunk then is must be aligned such that:

        double * d = (double *)( chunk + offset_d );

where:

        0 == offset_d % sizeof(double);

The key point is for the offset of each member within the chunk to have the correct alignment, and of course not overlap any other member.


