Does anyone understand the 'dummy' element in
include/parrot/stacks.h? Here is the relevant snippet:
typedef struct Stack_Chunk {
pobj_t obj;
int size;
const char * name;
struct Stack_Chunk *prev;
#if ! DISABLE_GC_DEBUG && defined(I386)
void * dummy; /* force 8 byte align for mmx and sse moves */
#endif
union { /* force appropriate alignment of 'data' */
void *data;
#ifndef I386
double d_dummy; /* align double values on stack */
#endif
} u;
} Stack_Chunk_t;
(I assume that mmx and sse are some sort of i386-specific instructions.)
Specifically, I'm wondering about two things:
1. Is the comment backwards? If I count correctly, including the
void *dummy means that u.data will *NOT* be aligned on an 8-byte
boundary. Is that the actual intent? (Of course, compilers are
free to add in extra padding inside structures, and it may end up
aligned with some compilers but not aligned with others.)
2. Why is this dummy element only inserted used when
! DISABLE_GC_DEBUG ?
--
Andy Dougherty [EMAIL PROTECTED]