[svn:parrot] r49664 - branches/generational_gc/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Oct 25 03:21:15 UTC 2010


Author: bacek
Date: Mon Oct 25 03:21:11 2010
New Revision: 49664
URL: https://trac.parrot.org/parrot/changeset/49664

Log:
Reorder setting flag in Packfile.init to avoid race condition with GC.

Modified:
   branches/generational_gc/src/pmc/packfile.pmc

Modified: branches/generational_gc/src/pmc/packfile.pmc
==============================================================================
--- branches/generational_gc/src/pmc/packfile.pmc	Mon Oct 25 03:15:17 2010	(r49663)
+++ branches/generational_gc/src/pmc/packfile.pmc	Mon Oct 25 03:21:11 2010	(r49664)
@@ -121,6 +121,9 @@
                 PMC_data_typed(SELF, Parrot_Packfile_attributes*);
         PackFile                   *pf;
 
+        /* copy_packfile_header can trigger GC. Set custom_mark flag early */
+        PObj_custom_mark_SET(SELF);
+
         attrs->uuid     = CONST_STRING(INTERP, "");
         attrs->directory = Parrot_pmc_new(INTERP, enum_class_PackfileDirectory);
 
@@ -128,8 +131,6 @@
         pf = PackFile_new(INTERP, 0);
         copy_packfile_header(INTERP, SELF, pf);
         PackFile_destroy(INTERP, pf);
-
-        PObj_custom_mark_SET(SELF);
     }
 
 


More information about the parrot-commits mailing list