[svn:parrot] r48444 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Fri Aug 13 06:39:11 UTC 2010
Author: NotFound
Date: Fri Aug 13 06:39:10 2010
New Revision: 48444
URL: https://trac.parrot.org/parrot/changeset/48444
Log:
Don't set custom mark flag on empty Capture
Modified:
trunk/src/pmc/capture.pmc
Modified: trunk/src/pmc/capture.pmc
==============================================================================
--- trunk/src/pmc/capture.pmc Fri Aug 13 00:07:10 2010 (r48443)
+++ trunk/src/pmc/capture.pmc Fri Aug 13 06:39:10 2010 (r48444)
@@ -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