[svn:parrot] r40364 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat Aug 1 21:49:44 UTC 2009
Author: NotFound
Date: Sat Aug 1 21:49:43 2009
New Revision: 40364
URL: https://trac.parrot.org/parrot/changeset/40364
Log:
[cage] cleanup init and destroy in String PMC, TT #895
Modified:
trunk/src/pmc/string.pmc
Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc Sat Aug 1 21:12:51 2009 (r40363)
+++ trunk/src/pmc/string.pmc Sat Aug 1 21:49:43 2009 (r40364)
@@ -36,9 +36,9 @@
VTABLE void init() {
Parrot_String_attributes *attrs =
mem_allocate_typed(Parrot_String_attributes);
-
- attrs->str_val = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0);
+ 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);
}
@@ -55,6 +55,7 @@
VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
+ PMC_data(SELF) = NULL;
}
More information about the parrot-commits
mailing list