[svn:parrot] r48448 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Fri Aug 13 07:48:54 UTC 2010
Author: NotFound
Date: Fri Aug 13 07:48:53 2010
New Revision: 48448
URL: https://trac.parrot.org/parrot/changeset/48448
Log:
Don't set custom mark flag on empty string arrays
Modified:
trunk/src/pmc/fixedstringarray.pmc
Modified: trunk/src/pmc/fixedstringarray.pmc
==============================================================================
--- trunk/src/pmc/fixedstringarray.pmc Fri Aug 13 07:36:33 2010 (r48447)
+++ trunk/src/pmc/fixedstringarray.pmc Fri Aug 13 07:48:53 2010 (r48448)
@@ -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