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

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Fri Apr 10 22:12:38 UTC 2009


Author: whiteknight
Date: Fri Apr 10 22:12:37 2009
New Revision: 38038
URL: https://trac.parrot.org/parrot/changeset/38038

Log:
add a custom destroy method to the Pointer PMC, so it can free the new memory that it allocates

Modified:
   trunk/src/pmc/pointer.pmc

Modified: trunk/src/pmc/pointer.pmc
==============================================================================
--- trunk/src/pmc/pointer.pmc	Fri Apr 10 22:05:53 2009	(r38037)
+++ trunk/src/pmc/pointer.pmc	Fri Apr 10 22:12:37 2009	(r38038)
@@ -37,12 +37,27 @@
 */
 
     VTABLE void init() {
-        PObj_custom_mark_SET(SELF);
+        PObj_custom_mark_destroy_SETALL(SELF);
         PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Pointer_attributes);
     }
 
 /*
 
+=item C<void destroy()>
+
+Destroy the Pointer and free associated memory
+
+=cut
+
+*/
+
+    VTABLE void destroy() {
+        mem_sys_free(PARROT_POINTER(SELF));
+    }
+
+
+/*
+
 =item C<void mark()>
 
 Marks the pointer as live.


More information about the parrot-commits mailing list