It has been noted that doubles must be aligned on double boundaries
for some CPU's.
struct _MemChunk {
void **freeList;
void *objCache;
int count;
double dummy;
MemChunk *next;
MemChunk *prev;
};
when printing out offsets from start of structure, I get:
chunk->freeList: 0
chunk->objCache: 4
chunk->count: 8
chunk->dummy: 12
chunk->next: 20
chunk->prev: 24
showing that gcc has NOT aligned double on 8-byte, but 4-byte.
this is on Intel. Should I assume that CC behaves differently
depending on CPU?
How can I determite required alignment for the system in code?
------------------------------------
Andres Kroonmaa <andre@online.ee>
Delfi Online
Tel: 6501 731, Fax: 6501 708
Pärnu mnt. 158, Tallinn,
11317 Estonia
Received on Thu Nov 02 2000 - 03:47:33 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:54 MST