Author: chromatic
Date: Sat Apr 28 22:49:13 2007
New Revision: 18354

Modified:
   trunk/include/parrot/stacks.h
   trunk/src/stack_common.c

Log:
Improve size and alignment of Stack_Chunk_t (Andy Dougherty, RT #42772).

Modified: trunk/include/parrot/stacks.h
==============================================================================
--- trunk/include/parrot/stacks.h       (original)
+++ trunk/include/parrot/stacks.h       Sat Apr 28 22:49:13 2007
@@ -29,13 +29,11 @@
     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' */
+    union { /* force appropriate alignment of 'data'.  If alignment
+               is necessary, assume double is good enough.  27-04-2007. */
         void *data;
-#ifndef I386
-        double d_dummy;         /* align double values on stack */
+#if PARROT_PTR_ALIGNMENT > 1
+        double d_dummy;
 #endif
     } u;
 } Stack_Chunk_t;

Modified: trunk/src/stack_common.c
==============================================================================
--- trunk/src/stack_common.c    (original)
+++ trunk/src/stack_common.c    Sat Apr 28 22:49:13 2007
@@ -59,9 +59,6 @@
     Stack_Chunk_t *chunk;
 
     item_size += offsetof(Stack_Chunk_t, u.data);
-    item_size += 7;
-    item_size &= ~7;    /* round up to 8 so that the chunk is aligned at
-                           the same size - the aligned MMX memcpy needs it */
     make_bufferlike_pool(interp, item_size);
     chunk = (Stack_Chunk_t *)new_bufferlike_header(interp, item_size);
     chunk->prev = chunk;        /* mark the top of the stack */

Reply via email to