[svn:parrot] r47205 - branches/gc_massacre/src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon May 31 10:20:20 UTC 2010


Author: bacek
Date: Mon May 31 10:20:19 2010
New Revision: 47205
URL: https://trac.parrot.org/parrot/changeset/47205

Log:
Invoke M&S earlier during allocating of new pmc header.

Modified:
   branches/gc_massacre/src/gc/gc_tms.c

Modified: branches/gc_massacre/src/gc/gc_tms.c
==============================================================================
--- branches/gc_massacre/src/gc/gc_tms.c	Mon May 31 10:19:40 2010	(r47204)
+++ branches/gc_massacre/src/gc/gc_tms.c	Mon May 31 10:20:19 2010	(r47205)
@@ -584,6 +584,11 @@
     List_Item_Header *ptr;
     PMC              *ret;
 
+    /* Invoke M&S early. Freshly allocated "header" isn't header yet */
+    if (++self->header_allocs_since_last_collect > 1024) {
+        gc_tms_mark_and_sweep(interp, 0);
+    }
+
     /* Allocate "constant" PMCs from constant allocator and forget about them */
     if (flags & PObj_constant_FLAG) {
         ptr = (List_Item_Header *)Parrot_gc_pool_allocate(interp,
@@ -595,14 +600,7 @@
         Parrot_gc_list_append(interp, self->objects, ptr);
     }
 
-    /* Save real pointer on stack. Otherwise it will not be traced */
-    ret = LLH2Obj_typed(ptr, PMC);
-
-    if (++self->header_allocs_since_last_collect > 1024) {
-        gc_tms_mark_and_sweep(interp, 0);
-    }
-
-    return ret;
+    return LLH2Obj_typed(ptr, PMC);
 }
 
 static void


More information about the parrot-commits mailing list