| parrotcode: general Parrot API for GC functions | |
| Contents | C |

src/gc/api.c - general Parrot API for GC functions

This file implements dead object destruction. This is documented in PDD 9 with supplementary notes in docs/dev/dod.pod and docs/memory_internals.pod.
It's possible to turn on/off the checking of the system stack and processor registers.
The actual checking is set up in src/cpu_dep.c and is performed in the function trace_memory_block here.
There's also a verbose mode for garbage collection.

PMC *new_pmc_headerNULL.
static PMC_EXT *new_pmc_extPMC_EXT structure from the PMC_EXT pool.
A pointer to the new PMC_EXT is returned.
Does not check to ensure the PMC_EXT is non-null before it is returned (yet).
void add_pmc_extPMC_EXT structure,
and attaches it to the given PMC.
Sets the necessary flags associated with the PMC_EXT structure.
Ensures that the PMC_EXT structure is marked as "alive" by the GC.
void add_pmc_syncSync* structure to the given PMC.
Initializes the PMC's owner field and the synchronization mutext.
Does not check to ensure the Sync * is non-null.
STRING *new_string_headerSTRING header from the string pool or the constant string pool.
Sets default flags on the string object: PObj_is_string_FLAG,
PObj_is_COWable_FLAG,
and PObj_live_FLAG (for GC).
Initializes the data field of the string buffer to NULL.
Buffer *new_buffer_headerBuffer from the buffer header pool.
Calls get_free_buffer to do all the work.
void *new_bufferlike_headervoid Parrot_gc_free_pmcdestroy VTABLE method if one is available.
If the PMC uses a PMC_EXT structure,
that is freed as well.
void Parrot_gc_free_pmc_extPMC_EXT structure attached to a PMC,
if it exists.
void Parrot_gc_free_sysmemvoid Parrot_gc_free_buffer_mallocvoid Parrot_gc_free_bufferstatic size_t find_common_maskval1 and val2.
void trace_mem_blocklo_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.
void Parrot_gc_profile_startvoid Parrot_gc_profile_endwhat run when profiling is enabled.
Also record start time of next part.
void Parrot_gc_ms_run_initvoid Parrot_do_dod_run
include/parrot/gc_api.h, src/cpu_dep.c, docs/dev/dod.dev and docs/pdds/pdd09_gc.pod.

Initial version by Mike Lambert on 2002.05.27.
|
|
|