Saturday, July 6, 2013

C Structure Alignment/Padding

Take the following C structure:

typedef struct dataPoint {
tick * tickData;
struct dataPoint * previousDataPoint;
struct dataPoint * nextDataPoint;
} dataPoint;


Compiling on a 64-bit system with 8-byte words, this structure takes up 24 bytes (3 words) of memory.
24 % 8 = 0 ... - Full Post

No comments:

Post a Comment