[svn:parrot] r40427 - branches/auto_attrs/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu Aug 6 12:49:56 UTC 2009


Author: NotFound
Date: Thu Aug  6 12:49:56 2009
New Revision: 40427
URL: https://trac.parrot.org/parrot/changeset/40427

Log:
set auto_attrs in exporter and pointer PMCs

Modified:
   branches/auto_attrs/src/pmc/exporter.pmc
   branches/auto_attrs/src/pmc/pointer.pmc

Modified: branches/auto_attrs/src/pmc/exporter.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/exporter.pmc	Thu Aug  6 12:22:45 2009	(r40426)
+++ branches/auto_attrs/src/pmc/exporter.pmc	Thu Aug  6 12:49:56 2009	(r40427)
@@ -90,7 +90,7 @@
 
 */
 
-pmclass Exporter need_ext {
+pmclass Exporter need_ext auto_attrs {
 
     ATTR PMC *ns_src;
     ATTR PMC *ns_dest;
@@ -107,10 +107,6 @@
 */
 
     VTABLE void init() {
-        Parrot_Exporter_attributes * const exp =
-            mem_allocate_zeroed_typed(Parrot_Exporter_attributes);
-        PMC_data(SELF)       = exp;
-
         /* Set up the object. */
         SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
         SET_ATTR_ns_dest(INTERP, SELF, CONTEXT(interp)->current_namespace);
@@ -118,26 +114,8 @@
 
         /* Set flags for custom GC mark and destroy. */
         PObj_custom_mark_SET(SELF);
-        PObj_active_destroy_SET(SELF);
     }
 
-
-/*
-
-=item C<void destroy()>
-
-Free the memory associated with the object's underlying struct.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
-    }
-
-
 /*
 
 =item C<void mark()>

Modified: branches/auto_attrs/src/pmc/pointer.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/pointer.pmc	Thu Aug  6 12:22:45 2009	(r40426)
+++ branches/auto_attrs/src/pmc/pointer.pmc	Thu Aug  6 12:49:56 2009	(r40427)
@@ -20,7 +20,7 @@
 
 */
 
-pmclass Pointer need_ext {
+pmclass Pointer need_ext auto_attrs {
     ATTR void * mark_function;
     ATTR void * pointer;
 
@@ -35,28 +35,11 @@
 */
 
     VTABLE void init() {
-        PObj_custom_mark_destroy_SETALL(SELF);
-        PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Pointer_attributes);
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroy the Pointer and free associated memory
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PARROT_POINTER(SELF));
-        PMC_data(SELF) = NULL;
-    }
-
-
-/*
-
 =item C<void mark()>
 
 Marks the pointer as live.


More information about the parrot-commits mailing list