[svn:parrot] r48467 - branches/gc_threshold_tuning/src/pmc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Aug 14 00:32:17 UTC 2010


Author: chromatic
Date: Sat Aug 14 00:32:16 2010
New Revision: 48467
URL: https://trac.parrot.org/parrot/changeset/48467

Log:
Don't set custom mark flag on empty Capture

Modified:
   branches/gc_threshold_tuning/src/pmc/capture.pmc

Modified: branches/gc_threshold_tuning/src/pmc/capture.pmc
==============================================================================
--- branches/gc_threshold_tuning/src/pmc/capture.pmc	Fri Aug 13 23:42:30 2010	(r48466)
+++ branches/gc_threshold_tuning/src/pmc/capture.pmc	Sat Aug 14 00:32:16 2010	(r48467)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2009, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -26,6 +26,7 @@
     do { \
         GETATTR_Capture_array((i), (obj), (arr)); \
         if (!(arr)) { \
+            PObj_custom_mark_SET(obj); \
             (arr) = Parrot_pmc_new((i), enum_class_ResizablePMCArray); \
             SETATTR_Capture_array((i), (obj), (arr)); \
         } \
@@ -34,6 +35,7 @@
     do { \
         GETATTR_Capture_hash((i), (obj), (hsh)); \
         if (!(hsh)) { \
+            PObj_custom_mark_SET(obj); \
             (hsh) = Parrot_pmc_new((i), enum_class_Hash); \
             SETATTR_Capture_hash((i), (obj), (hsh)); \
         } \
@@ -45,20 +47,6 @@
 
 /*
 
-=item C<void init()>
-
-Initializes the Capture instance.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        PObj_custom_mark_SET(SELF);
-    }
-
-/*
-
 =item C<PMC *clone()>
 
 Creates an identical copy of the Capture.
@@ -72,12 +60,16 @@
         PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF));
         GET_ATTR_array(INTERP, SELF, array);
         GET_ATTR_hash(INTERP, SELF, hash);
-        if (array)
-             array = VTABLE_clone(INTERP, array);
-        if (hash)
-             hash = VTABLE_clone(INTERP, hash);
-        SET_ATTR_array(INTERP, dest, array);
-        SET_ATTR_hash(INTERP, dest, hash);
+        if (!PMC_IS_NULL(array)) {
+            PObj_custom_mark_SET(dest);
+            array = VTABLE_clone(INTERP, array);
+            SET_ATTR_array(INTERP, dest, array);
+        }
+        if (!PMC_IS_NULL(hash)) {
+            PObj_custom_mark_SET(dest);
+            hash = VTABLE_clone(INTERP, hash);
+            SET_ATTR_hash(INTERP, dest, hash);
+        }
 
         return dest;
     }


More information about the parrot-commits mailing list