[svn:parrot] r43956 - trunk/src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Feb 14 22:01:04 UTC 2010


Author: bacek
Date: Sun Feb 14 22:01:02 2010
New Revision: 43956
URL: https://trac.parrot.org/parrot/changeset/43956

Log:
Change aligned_mem function to behave exactly same as
aligned_string_size. Closes TT#1443.

Modified:
   trunk/src/gc/alloc_resources.c

Modified: trunk/src/gc/alloc_resources.c
==============================================================================
--- trunk/src/gc/alloc_resources.c	Sun Feb 14 18:51:05 2010	(r43955)
+++ trunk/src/gc/alloc_resources.c	Sun Feb 14 22:01:02 2010	(r43956)
@@ -670,6 +670,10 @@
 aligned_mem(ARGIN(const Buffer *buffer), ARGIN(char *mem))
 {
     ASSERT_ARGS(aligned_mem)
+#if 0
+    This code causing assert in compact_pool. Looks like STRINGs have
+    aligned flag set, but allocated less memory.
+    See C<aligned_string_size>.
     if (PObj_is_COWable_TEST(buffer))
         mem += sizeof (void*);
     if (PObj_aligned_TEST(buffer))
@@ -677,6 +681,9 @@
                 BUFFER_ALIGN_MASK);
     else
         mem = (char*)(((unsigned long)(mem + WORD_ALIGN_1)) & WORD_ALIGN_MASK);
+#endif
+    mem += sizeof (void*);
+    mem = (char*)(((unsigned long)(mem + WORD_ALIGN_1)) & WORD_ALIGN_MASK);
 
     return mem;
 }


More information about the parrot-commits mailing list