[svn:parrot] r41196 - trunk/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Sep 10 23:28:31 UTC 2009


Author: bacek
Date: Thu Sep 10 23:28:30 2009
New Revision: 41196
URL: https://trac.parrot.org/parrot/changeset/41196

Log:
[cage] Remove redunant CPointer.destroy. Fix CPointer.clone to use allocated attributes.

Modified:
   trunk/src/pmc/cpointer.pmc

Modified: trunk/src/pmc/cpointer.pmc
==============================================================================
--- trunk/src/pmc/cpointer.pmc	Thu Sep 10 23:23:10 2009	(r41195)
+++ trunk/src/pmc/cpointer.pmc	Thu Sep 10 23:28:30 2009	(r41196)
@@ -64,7 +64,7 @@
         SET_ATTR_pointer(INTERP, SELF, NULL);
         SET_ATTR_sig(INTERP, SELF, NULL);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
@@ -103,19 +103,6 @@
 
 /*
 
-=item C<void destroy()>
-
-Destroys the PMC and frees all allocated memory.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-    }
-
-/*
-
 =item C<PMC *clone()>
 
 Creates and returns a clone of the pointer.
@@ -126,8 +113,16 @@
 
     VTABLE PMC *clone() {
         PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
+        void       *ptr;
+        STRING     *sig;
+
+        GET_ATTR_pointer(INTERP, SELF, ptr);
+        SET_ATTR_pointer(INTERP, dest, ptr);
+
+        GET_ATTR_sig(INTERP, SELF, sig);
+        SET_ATTR_sig(INTERP, dest, sig);
+
         PObj_custom_mark_SET(dest);
-        PMC_data(dest) = PMC_data(SELF);
         return dest;
     }
 


More information about the parrot-commits mailing list