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

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


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

Log:
Don't set custom mark flag on empty string arrays

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

Modified: branches/gc_threshold_tuning/src/pmc/fixedstringarray.pmc
==============================================================================
--- branches/gc_threshold_tuning/src/pmc/fixedstringarray.pmc	Sat Aug 14 00:32:26 2010	(r48470)
+++ branches/gc_threshold_tuning/src/pmc/fixedstringarray.pmc	Sat Aug 14 00:32:29 2010	(r48471)
@@ -35,20 +35,6 @@
 
 =over 4
 
-=item C<void init()>
-
-Initializes the array.
-
-=cut
-
-*/
-
-    VTABLE void init() {
-        PObj_custom_mark_destroy_SETALL(SELF);
-    }
-
-/*
-
 =item C<void init_int(INTVAL size)>
 
 Initializes the array.
@@ -61,9 +47,11 @@
         if (size < 0)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS,
                 _("FixedStringArray: Cannot set array size to a negative number (%d)"), size);
-        SET_ATTR_size(INTERP, SELF, size);
-        SET_ATTR_str_array(INTERP, SELF, mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *));
-        PObj_custom_mark_destroy_SETALL(SELF);
+        if (size) {
+            SET_ATTR_size(INTERP, SELF, size);
+            SET_ATTR_str_array(INTERP, SELF, mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *));
+            PObj_custom_mark_destroy_SETALL(SELF);
+        }
     }
 
 


More information about the parrot-commits mailing list