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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Tue Aug 11 06:55:56 UTC 2009


Author: NotFound
Date: Tue Aug 11 06:55:54 2009
New Revision: 40482
URL: https://trac.parrot.org/parrot/changeset/40482

Log:
set auto_attrs on the String PMC

Modified:
   branches/auto_attrs/src/pmc/string.pmc

Modified: branches/auto_attrs/src/pmc/string.pmc
==============================================================================
--- branches/auto_attrs/src/pmc/string.pmc	Tue Aug 11 06:09:35 2009	(r40481)
+++ branches/auto_attrs/src/pmc/string.pmc	Tue Aug 11 06:55:54 2009	(r40482)
@@ -20,7 +20,7 @@
 
 */
 
-pmclass String extends scalar provides string provides scalar {
+pmclass String extends scalar provides string provides scalar auto_attrs {
     ATTR STRING * str_val;
 
 /*
@@ -34,33 +34,14 @@
 */
 
     VTABLE void init() {
-        Parrot_String_attributes *attrs =
-            mem_allocate_typed(Parrot_String_attributes);
         STRING *str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
-        PMC_data(SELF) = attrs;
         SET_ATTR_str_val(INTERP, SELF, str_val);
 
-        PObj_custom_mark_destroy_SETALL(SELF);
+        PObj_custom_mark_SET(SELF);
     }
 
 /*
 
-=item C<void destroy()>
-
-Destroys this String PMC.
-
-=cut
-
-*/
-
-    VTABLE void destroy() {
-        mem_sys_free(PMC_data(SELF));
-        PMC_data(SELF) = NULL;
-    }
-
-
-/*
-
 =item C<PMC instantiate_str(STRING *rep)>
 
 Class method to construct a String from the string representation C<rep>.
@@ -111,7 +92,6 @@
 
     VTABLE PMC *clone() {
         PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type);
-        PObj_custom_mark_destroy_SETALL(dest);
         VTABLE_set_string_native(INTERP, dest, Parrot_str_copy(INTERP, SELF.get_string()));
         return dest;
     }


More information about the parrot-commits mailing list