NAME
src/gc/system.c - CPU-dependent mark/sweep functions
DESCRIPTION
These functions setup a trace of the current processor context and the system stack.
The trace is set up here in trace_system_areas
.
This function gets the current processor context and either traces it directly or stores it on the system stack.
trace_system_stack
sets up a trace of the system stack using two marker addresses as boundaries.
The code to actually perform the trace of a memory block between two boundaries is located in src/gc/api.c:trace_mem_block
.
TT #273: This file needs to be cleaned up significantly.
Functions
void trace_system_areas
Initiates a trace of the system stack,
looking for pointers which are being used by functions in the call chain,
but which might not be marked as alive in any other way.
Setting the trace up,
which involves storing the processor context onto the stack,
is highly system dependent.
However,
once stored,
tracing the stack is very straightforward.
static void trace_system_stack
Traces the memory block starting at static size_t find_common_mask
Finds a mask covering the longest common bit-prefix of void trace_mem_block
Traces the memory block between
interp->lo_var_ptr
.
This should be the address of a local variable which has been created on the stack early in the interpreter's lifecycle.
We trace until the address of another local stack variable in this function,
which should be at the "top" of the stack.
val1
and val2
.
lo_var_ptr
and hi_var_ptr
.
Attempt to find pointers to PObjs or buffers,
and mark them as "alive" if found.
See src/cpu_dep.c for more information about tracing memory areas.SEE ALSO
src/gc/api.c and include/parrot/gc_api.h.