commit 3a339ee8ab3a72867fe914ec9c689e1f5a890645 Author: tcurtis Date: Tue Aug 24 15:52:28 2010 -0500 Switch objectref_pmc.template to auto_attrs. Fixes a nasty memory leak that would leak at least 3 scalars per block. Now a simple 'while 1 { }' loop seems not to leak anymore. Signed-off-by: Moritz Lenz diff --git a/src/pmc/objectref_pmc.template b/src/pmc/objectref_pmc.template index d0a8daa..cafc1d2 100644 --- a/src/pmc/objectref_pmc.template +++ b/src/pmc/objectref_pmc.template @@ -19,7 +19,7 @@ Forwards all but some methods to the held PMC. #include "parrot/parrot.h" static STRING *OBJECTREF_str; -pmclass ObjectRef dynpmc group perl6_group manual_attrs { +pmclass ObjectRef dynpmc group perl6_group auto_attrs { ATTR PMC *value; void class_init() { @@ -36,10 +36,6 @@ pmclass ObjectRef dynpmc group perl6_group manual_attrs { VTABLE void init_pmc(PMC *value) { /* Need custom mark and destroy. */ PObj_custom_mark_SET(SELF); - PObj_custom_destroy_SET(SELF); - - /* Create underlying structure. */ - PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_ObjectRef_attributes); /* Initialize with an undef PMC if no value. */ if (PMC_IS_NULL(value)) @@ -56,11 +52,6 @@ pmclass ObjectRef dynpmc group perl6_group manual_attrs { } } - VTABLE void destroy() { - mem_sys_free(PMC_data(SELF)); - PMC_data(SELF) = NULL; - } - VTABLE PMC * get_pmc() { PMC * value; GET_ATTR_value(INTERP, SELF, value);