diff --git a/src/pmc/arccons.pmc b/src/pmc/arccons.pmc index ad8ee4d..be9ffef 100644 --- a/src/pmc/arccons.pmc +++ b/src/pmc/arccons.pmc @@ -22,7 +22,7 @@ pmclass ArcCons VTABLE void init() { PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_ArcCons_attributes); - PObj_custom_mark_SET(SELF); + PObj_custom_mark_destroy_SETALL(SELF); } VTABLE void mark() { @@ -31,14 +31,16 @@ pmclass ArcCons pobject_lives(INTERP, (PObj *)c->the_car); if (c->the_cdr) pobject_lives(INTERP, (PObj *)c->the_cdr); - /* - PMC *obj; - GET_ATTR_the_car(INTERP, SELF, obj); - pobject_lives(INTERP, (PObj*)obj); - GET_ATTR_the_cdr(INTERP, SELF, obj); - pobject_lives(INTERP, (PObj*)obj);*/ } - + + VTABLE void destroy() { + Parrot_ArcCons_attributes *c = PARROT_ARCCONS(SELF); + if (c) { + mem_sys_free(c); + PMC_data(SELF) = NULL; + } + } + VTABLE STRING* name() { return Parrot_str_new_constant(INTERP, "cons"); } diff --git a/src/pmc/arcsym.pmc b/src/pmc/arcsym.pmc index df9d10e..8bb34d9 100644 --- a/src/pmc/arcsym.pmc +++ b/src/pmc/arcsym.pmc @@ -10,13 +10,21 @@ pmclass ArcSym VTABLE void init() { Parrot_ArcSym_attributes *u = mem_allocate_zeroed_typed(Parrot_ArcSym_attributes); PMC_data(SELF) = u; - PObj_custom_mark_SET(SELF); + PObj_custom_mark_destroy_SETALL(SELF); } VTABLE void mark() { Parrot_ArcSym_attributes *s = PARROT_ARCSYM(SELF); if (s->repr) pobject_lives(INTERP, (PObj *)s->repr); + + } + VTABLE void destroy() { + Parrot_ArcSym_attributes *s = PARROT_ARCSYM(SELF); + if (s) { + mem_sys_free(s); + PMC_data(SELF) = NULL; + } } VTABLE STRING* name() {