Index: src/oo.c =================================================================== --- src/oo.c (revision 40931) +++ src/oo.c (working copy) @@ -286,7 +286,7 @@ /* Set custom GC mark and destroy on the object. */ PObj_custom_mark_SET(cloned); - PObj_active_destroy_SET(cloned); + PObj_custom_destroy_SET(cloned); /* Flag that it is an object */ PObj_is_object_SET(cloned); Index: src/ops/set.ops =================================================================== --- src/ops/set.ops (revision 40931) +++ src/ops/set.ops (working copy) @@ -507,7 +507,7 @@ memmove($1, clone, sizeof (PMC)); /* don't let the clone's destruction destroy the destination's data */ - PObj_active_destroy_CLEAR(clone); + PObj_custom_destroy_CLEAR(clone); PMC_data(clone) = NULL; PMC_metadata(clone) = NULL; PMC_next_for_GC(clone) = NULL; Index: src/gc/generational_ms.c =================================================================== --- src/gc/generational_ms.c (revision 40931) +++ src/gc/generational_ms.c (working copy) @@ -606,7 +606,7 @@ =item C -TODO: interfere active_destroy and put these items into a +TODO: interfere custom_destroy and put these items into a separate white area, so that a sweep has just to run through these objects @@ -1691,7 +1691,7 @@ PMC * const obj = (PMC*)GMSH_to_PObj(h); if (PObj_needs_early_gc_TEST(obj)) --arena_base->num_early_gc_PMCs; - if (PObj_active_destroy_TEST(obj)) + if (PObj_custom_destroy_TEST(obj)) VTABLE_destroy(interp, (PMC *)obj); } pool->free_list = pool->white; Index: src/pmc.c =================================================================== --- src/pmc.c (revision 40931) +++ src/pmc.c (working copy) @@ -109,10 +109,10 @@ { ASSERT_ARGS(Parrot_pmc_destroy) - if (PObj_active_destroy_TEST(pmc)) { + if (PObj_custom_destroy_TEST(pmc)) { VTABLE_destroy(interp, pmc); /* Prevent repeated calls. */ - PObj_active_destroy_CLEAR(pmc); + PObj_custom_destroy_CLEAR(pmc); } PObj_custom_mark_CLEAR(pmc); Index: src/pmc/lexinfo.pmc =================================================================== --- src/pmc/lexinfo.pmc (revision 40931) +++ src/pmc/lexinfo.pmc (working copy) @@ -71,7 +71,7 @@ (hash_hash_key_fn)Parrot_str_to_hashval); /* hash */ SELF.set_pointer(hash); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/class.pmc =================================================================== --- src/pmc/class.pmc (revision 40931) +++ src/pmc/class.pmc (working copy) @@ -1222,7 +1222,7 @@ /* Set custom GC mark and destroy on the object. */ PObj_custom_mark_SET(object); - PObj_active_destroy_SET(object); + PObj_custom_destroy_SET(object); /* Flag that it is an object */ PObj_is_object_SET(object); Index: src/pmc/object.pmc =================================================================== --- src/pmc/object.pmc (revision 40931) +++ src/pmc/object.pmc (working copy) @@ -714,7 +714,7 @@ VTABLE void thawfinish(visit_info *info) { /* Set custom GC mark and destroy on the object. */ PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); /* Flag that it is an object */ PObj_is_object_SET(SELF); Index: src/pmc/eventhandler.pmc =================================================================== --- src/pmc/eventhandler.pmc (revision 40931) +++ src/pmc/eventhandler.pmc (working copy) @@ -39,7 +39,7 @@ VTABLE void init() { PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* @@ -101,7 +101,7 @@ INTERP->iglobals, IGLOBALS_INTERPRETER); PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); e->type = type; e->code = code; Index: src/pmc/fixedfloatarray.pmc =================================================================== --- src/pmc/fixedfloatarray.pmc (revision 40931) +++ src/pmc/fixedfloatarray.pmc (working copy) @@ -73,7 +73,7 @@ dest_float_array = (FLOATVAL*)mem_sys_allocate(mem_size); mem_sys_memcopy(dest_float_array, self_float_array, mem_size); SET_ATTR_float_array(INTERP, dest, dest_float_array); - PObj_active_destroy_SET(dest); + PObj_custom_destroy_SET(dest); return dest; } @@ -290,7 +290,7 @@ SET_ATTR_size(INTERP, SELF, new_size); SET_ATTR_float_array(INTERP, SELF, mem_allocate_n_typed(new_size, FLOATVAL)); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/parrotinterpreter.pmc =================================================================== --- src/pmc/parrotinterpreter.pmc (revision 40931) +++ src/pmc/parrotinterpreter.pmc (working copy) @@ -242,7 +242,7 @@ if (!PMC_interp(SELF)) { create_interp(SELF, INTERP); } - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* @@ -268,7 +268,7 @@ if (!PMC_interp(SELF)) { create_interp(SELF, p); } - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } @@ -309,7 +309,7 @@ Parrot_ParrotInterpreter_attributes *attrs = mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes); PMC_data(SELF) = attrs; - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } PMC_interp(SELF) = (struct parrot_interp_t *)value; } @@ -722,7 +722,7 @@ Parrot_ParrotInterpreter_attributes *attrs = mem_allocate_zeroed_typed(Parrot_ParrotInterpreter_attributes); PMC_data(SELF) = attrs; - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } PMC_interp(SELF) = INTERP; Index: src/pmc/filehandle.pmc =================================================================== --- src/pmc/filehandle.pmc (revision 40931) +++ src/pmc/filehandle.pmc (working copy) @@ -84,7 +84,7 @@ data_struct->os_handle = (PIOHANDLE) PIO_INVALID_HANDLE; PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/exception.pmc =================================================================== --- src/pmc/exception.pmc (revision 40931) +++ src/pmc/exception.pmc (working copy) @@ -84,7 +84,7 @@ VTABLE void init() { /* Set flags for custom GC mark and destroy. */ - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); PObj_custom_mark_SET(SELF); SET_ATTR_severity(INTERP, SELF, EXCEPT_error); @@ -124,7 +124,7 @@ } /* Set flags for custom GC mark. */ - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); PObj_custom_mark_SET(SELF); /* Set up the core struct and default values for the exception object. */ Index: src/pmc/bigint.pmc =================================================================== --- src/pmc/bigint.pmc (revision 40931) +++ src/pmc/bigint.pmc (working copy) @@ -627,7 +627,7 @@ VTABLE void init() { bigint_init(INTERP, SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } VTABLE PMC *clone() { Index: src/pmc/timer.pmc =================================================================== --- src/pmc/timer.pmc (revision 40931) +++ src/pmc/timer.pmc (working copy) @@ -79,7 +79,7 @@ /* Set flags for custom GC mark and destroy. */ PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); /* Set up the core struct. */ core_struct->id = 0; Index: src/pmc/sockaddr.pmc =================================================================== --- src/pmc/sockaddr.pmc (revision 40931) +++ src/pmc/sockaddr.pmc (working copy) @@ -47,7 +47,7 @@ (Parrot_Sockaddr_attributes *) PMC_data(SELF); pdata_struct->pointer = mem_allocate_zeroed_typed(struct sockaddr_in); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/parrotrunningthread.pmc =================================================================== --- src/pmc/parrotrunningthread.pmc (revision 40931) +++ src/pmc/parrotrunningthread.pmc (working copy) @@ -50,7 +50,7 @@ mem_allocate_zeroed_typed(Parrot_ParrotRunningThread_attributes); attrs->tid = -1; PMC_data(SELF) = attrs; - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pextra_flags == EXTRA_IS_NULL) { IMAGE_IO * const io = info->image_io; Index: src/pmc/scheduler.pmc =================================================================== --- src/pmc/scheduler.pmc (revision 40931) +++ src/pmc/scheduler.pmc (working copy) @@ -52,7 +52,7 @@ /* Set flags for custom GC mark and destroy. */ PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); /* Set up the core struct. */ core_struct->id = 0; Index: src/pmc/resizablebooleanarray.pmc =================================================================== --- src/pmc/resizablebooleanarray.pmc (revision 40931) +++ src/pmc/resizablebooleanarray.pmc (working copy) @@ -392,7 +392,7 @@ SET_ATTR_bit_array(INTERP, dest, dest_bit_array); - PObj_active_destroy_SET(dest); + PObj_custom_destroy_SET(dest); return dest; } Index: src/pmc/bignum.pmc =================================================================== --- src/pmc/bignum.pmc (revision 40931) +++ src/pmc/bignum.pmc (working copy) @@ -841,7 +841,7 @@ VTABLE void init() { bignum_init(INTERP, SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } VTABLE PMC *clone() { Index: src/pmc/exceptionhandler.pmc =================================================================== --- src/pmc/exceptionhandler.pmc (revision 40931) +++ src/pmc/exceptionhandler.pmc (working copy) @@ -56,7 +56,7 @@ * context - the stacks can only be deeper in the interpreter - so no * mark of context is needed */ PObj_custom_mark_SET(SELF); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/parrotlibrary.pmc =================================================================== --- src/pmc/parrotlibrary.pmc (revision 40931) +++ src/pmc/parrotlibrary.pmc (working copy) @@ -46,7 +46,7 @@ */ VTABLE void init() { - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/managedstruct.pmc =================================================================== --- src/pmc/managedstruct.pmc (revision 40931) +++ src/pmc/managedstruct.pmc (working copy) @@ -46,7 +46,7 @@ */ VTABLE void init() { - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* Index: src/pmc/packfileannotation.pmc =================================================================== --- src/pmc/packfileannotation.pmc (revision 40931) +++ src/pmc/packfileannotation.pmc (working copy) @@ -42,7 +42,7 @@ Parrot_PackfileAnnotation_attributes * attrs = mem_allocate_zeroed_typed(Parrot_PackfileAnnotation_attributes); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); PMC_data(SELF) = attrs; } Index: src/pmc/fixedbooleanarray.pmc =================================================================== --- src/pmc/fixedbooleanarray.pmc (revision 40931) +++ src/pmc/fixedbooleanarray.pmc (working copy) @@ -45,7 +45,7 @@ */ VTABLE void init() { - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } /* @@ -97,7 +97,7 @@ SET_ATTR_bit_array(INTERP, dest, clone_bit_array); } - PObj_active_destroy_SET(dest); + PObj_custom_destroy_SET(dest); return dest; } Index: src/packdump.c =================================================================== --- src/packdump.c (revision 40931) +++ src/packdump.c (working copy) @@ -111,7 +111,7 @@ "on_free_list", "custom_mark", "custom_GC", - "active_destroy", + "custom_destroy", "report", "data_is_PMC_array", "need_finalize", Index: src/jit/i386/jit_defs.c =================================================================== --- src/jit/i386/jit_defs.c (revision 40931) +++ src/jit/i386/jit_defs.c (working copy) @@ -2410,7 +2410,7 @@ emitm_ret(pc); PARROT_ASSERT(pc - jit_info.arena.start <= JIT_ALLOC_SIZE); /* could shrink arena.start here to used size */ - PObj_active_destroy_SET(pmc_nci); + PObj_custom_destroy_SET(pmc_nci); if (sizeptr) *sizeptr = JIT_ALLOC_SIZE; return (void *)D2FPTR(jit_info.arena.start); Index: src/dynpmc/rational.pmc =================================================================== --- src/dynpmc/rational.pmc (revision 40931) +++ src/dynpmc/rational.pmc (working copy) @@ -269,7 +269,7 @@ PMC_data(SELF) = attrs; PMC_rational(SELF) = (RATIONAL *)malloc(sizeof (RATIONAL)); mpq_init(RT(SELF)); - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); #endif } Index: src/dynpmc/gdbmhash.pmc =================================================================== --- src/dynpmc/gdbmhash.pmc (revision 40931) +++ src/dynpmc/gdbmhash.pmc (working copy) @@ -105,7 +105,7 @@ attrs->db_handle = mem_allocate_zeroed_typed(GDBM_FH); PMC_data(SELF) = attrs; - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); } VTABLE void destroy() { Index: docs/embed.pod =================================================================== --- docs/embed.pod (revision 40931) +++ docs/embed.pod (working copy) @@ -1853,7 +1853,7 @@ =item C -=item C +=item C =item C Index: docs/vtables.pod =================================================================== --- docs/vtables.pod (revision 40931) +++ docs/vtables.pod (working copy) @@ -211,7 +211,7 @@ =item C Do any data shut-down and finalization you need to do. To have this method -called, you must set the C. +called, you must set the C. =item C Index: docs/pdds/pdd09_gc.pod =================================================================== --- docs/pdds/pdd09_gc.pod (revision 40931) +++ docs/pdds/pdd09_gc.pod (working copy) @@ -560,7 +560,7 @@ =over 4 -=item PObj_active_destroy_FLAG +=item PObj_custom_destroy_FLAG The PMC has some sort of active destructor, and will have that destructor called when the PMC is destroyed. The destructor is typically called from Index: docs/pmc.pod =================================================================== --- docs/pmc.pod (revision 40931) +++ docs/pmc.pod (working copy) @@ -42,7 +42,7 @@ C in the PMC's C and C VTABLE functions (if used) and it must be destroyed in the C VTABLE function. PMCs with ATTRs also need to indicate that they need active destruction by calling -C or C. +C or C. If your PMC only needs to store a single pointer, it can use C directly. Note that this may make maintaining your PMC difficult, should more data ever @@ -80,10 +80,10 @@ VTABLE function must call B on all Bs which your PMC contains. -=item PObj_active_destroy_FLAG +=item PObj_custom_destroy_FLAG If your PMC allocates any memory or opens any resources during its lifetime, it -must set B and implement the B VTABLE function to +must set B and implement the B VTABLE function to free those resources. =item PObj_needs_early_gc_FLAG Index: include/parrot/pobj.h =================================================================== --- include/parrot/pobj.h (revision 40931) +++ include/parrot/pobj.h (working copy) @@ -192,7 +192,7 @@ /* Mark the buffer as needing GC */ PObj_custom_GC_FLAG = POBJ_FLAG(21), /* Set if the PObj has a destroy method that must be called */ - PObj_active_destroy_FLAG = POBJ_FLAG(22), + PObj_custom_destroy_FLAG = POBJ_FLAG(22), /* For debugging, report when this buffer gets moved around */ PObj_report_FLAG = POBJ_FLAG(23), @@ -290,7 +290,7 @@ #define PObj_special_CLEAR(flag, o) do { \ PObj_flag_CLEAR(flag, o); \ if ((PObj_get_FLAGS(o) & \ - (PObj_active_destroy_FLAG | \ + (PObj_custom_destroy_FLAG | \ PObj_custom_mark_FLAG | \ PObj_needs_early_gc_FLAG))) \ gc_flag_SET(is_special_PMC, o); \ @@ -313,10 +313,17 @@ #define PObj_custom_mark_CLEAR(o) PObj_special_CLEAR(custom_mark, o) #define PObj_custom_mark_TEST(o) PObj_flag_TEST(custom_mark, o) -#define PObj_active_destroy_SET(o) PObj_flag_SET(active_destroy, o) -#define PObj_active_destroy_TEST(o) PObj_flag_TEST(active_destroy, o) -#define PObj_active_destroy_CLEAR(o) PObj_flag_CLEAR(active_destroy, o) +#define PObj_custom_destroy_SET(o) PObj_flag_SET(custom_destroy, o) +#define PObj_custom_destroy_TEST(o) PObj_flag_TEST(custom_destroy, o) +#define PObj_custom_destroy_CLEAR(o) PObj_flag_CLEAR(custom_destroy, o) +/***************************************************** + * DEPRECATED -- use PObj_custom_destroy_FOO() instead + ******************************************************/ +#define PObj_active_destroy_SET(o) PObj_flag_SET(custom_destroy, o) +#define PObj_active_destroy_TEST(o) PObj_flag_TEST(custom_destroy, o) +#define PObj_active_destroy_CLEAR(o) PObj_flag_CLEAR(custom_destroy, o) + #define PObj_is_class_SET(o) PObj_flag_SET(is_class, o) #define PObj_is_class_TEST(o) PObj_flag_TEST(is_class, o) #define PObj_is_class_CLEAR(o) PObj_flag_CLEAR(is_class, o) @@ -357,7 +364,7 @@ #define PObj_custom_mark_destroy_SETALL(o) do { \ PObj_custom_mark_SET(o); \ - PObj_active_destroy_SET(o); \ + PObj_custom_destroy_SET(o); \ } while (0) #endif /* PARROT_POBJ_H_GUARD */ Index: config/gen/crypto/digest_pmc.in =================================================================== --- config/gen/crypto/digest_pmc.in (revision 40931) +++ config/gen/crypto/digest_pmc.in (working copy) @@ -36,7 +36,7 @@ @TEMP_md_guard@ @TEMP_md_ctx@ *c = mem_allocate_zeroed_typed(@TEMP_md_ctx@); PMC_data(SELF) = c; - PObj_active_destroy_SET(SELF); + PObj_custom_destroy_SET(SELF); #else Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT, "@TEMP_md_name@ is disabled"); @@ -75,7 +75,7 @@ memcpy(c, PMC_data(SELF), sizeof (@TEMP_md_ctx@)); PMC_data(retval) = c; - PObj_active_destroy_SET(retval); + PObj_custom_destroy_SET(retval); return retval; #else return NULL;