parrotcode: Dead object destruction of the various headers | |
Contents | C |
src/dod.c - Dead object destruction of the various headers
This file implements dead object destruction. This is documented in PDD 9 with supplementary notes in docs/dev/dod.dev.
It's possible to turn on/off the checking of the system stack and processor registers. The actual checking is implemented in src/cpu_dep.c.
There's also a verbose mode for garbage collection.
static void mark_special(Parrot_Interp interpreter, PMC *obj)
PMC_EXT
structure,
append or prepend the next_for_GC
pointer; otherwise,
do the custom mark directly.void pobject_lives(Interp *interpreter, PObj *obj)
obj
as alive.static int trace_active_PMCs(Interp *interpreter, int trace_stack)
int Parrot_dod_trace_root(Interp *interpreter, int trace_stack)
trace_stack
can have these values: 0 ... trace normal roots, no system areas
1 ... trace whole root set
2 ... trace system areas only
int Parrot_dod_trace_children(Interp *interpreter, size_t how_many)
static void trace_active_buffers(Interp *interpreter)
void clear_cow(Interp *interpreter, struct Small_Object_Pool *pool, int cleanup)
void used_cow(Interp *interpreter, struct Small_Object_Pool *pool, int cleanup)
bufstart
.static void clear_live_counter(Interp *interpreter, struct Small_Object_Pool *pool)
static void reduce_arenas(Interp *interpreter, struct Small_Object_Pool *pool, UINTVAL free_arenas)
void Parrot_dod_sweep(Interp *interpreter, struct Small_Object_Pool *pool)
GC_IS_MALLOC
, bufstart gets freed too, if possible. Avoid buffers that are immune from collection (i.e. constant).static size_t find_common_mask(size_t val1, size_t val2)
val1
and val2
.void trace_mem_block(Interp *interpreter, size_t lo_var_ptr, size_t hi_var_ptr)
lo_var_ptr
and hi_var_ptr
.static void Parrot_dod_clear_live_bits(Parrot_Interp interpreter)
void Parrot_dod_profile_start(Parrot_Interp interpreter)
void Parrot_dod_profile_end(Parrot_Interp interpreter, int what)
what
run when profiling is enabled. Also record start time of next part.void Parrot_do_dod_run(Interp *interpreter, UINTVAL flags)
void parrot_dod_ms_run(Interp *interpreter, UINTVAL flags)
void Parrot_dod_ms_run_init(Interp *interpreter, UINTVAL flags)
include/parrot/dod.h, src/cpu_dep.c, docs/dev/dod.dev and docs/pdds/pdd09_gc.pod.
Initial version by Mike Lambert on 2002.05.27.
|