| parrotcode: Header management functions | |
| Contents | C |

src/gc/pools.c - Header management functions

Handles pool creation for PMC headers.

void *get_free_bufferpool and returns it.
If the object is larger then a standard PObj structure,
all additional memory is cleared.
Small_Object_Pool *new_pmc_poolSmall_Object_Pool *new_bufferlike_poolget_bufferlike_pool(),
and should probably not be called directly.
Small_Object_Pool *new_buffer_poolSmall_Object_Pool structure for managing buffer objects.Non-constant strings and plain Buffers are stored in the sized header pools.
Small_Object_Pool *new_string_poolSTRINGs and returns it.
This calls get_bufferlike_pool internally,
which in turn calls new_bufferlike_pool.
Small_Object_Pool *get_bufferlike_poolsize_t get_max_buffer_addressend_arena_memory field is the highest.
Notice that arenas in each pool are not necessarily located directly next to each other in memory,
and the last arena in the pool's list may not be located at the highest memory address.
size_t get_min_buffer_addressstart_arena_memory field.
Notice that the memory region between get_min_buffer_address and get_max_buffer_address may be fragmented,
and parts of it may not be available for Parrot to use directly (such as bookkeeping data for the OS memory manager).
size_t get_max_pmc_addresspmc_pool.
size_t get_min_pmc_addresspmc_pool.
Notice that the memory region between get_min_pmc_address and get_max_pmc_address may be fragmented,
and not all of it may be used directly by Parrot for storing PMCs.
int is_buffer_ptrptr is located within one of the sized header pools.
Returns 1 if it is,
and 0 if not.
int is_pmc_ptrptr is actually a PMC pointer.
Returns 1 if it is,
0 otherwise.
void Parrot_initialize_header_poolsstring_header_pool and buffer_header_pool are actually both in the sized pools,
although no other sized pools are created here.
int Parrot_forall_header_poolsPOOL_PMC POOL_BUFFER POOL_CONST POOL_ALLOnly matching pools will be used. Notice that it is not possible to iterate over certain sets of pools using the provided flags in the single pass. For instance, both the PMC pool and the constant PMC pool cannot be iterated over in a single pass.
(Parrot_Interp, Small_Object_Pool *, int flag, void *arg). If the function returns a non-zero value, iteration will stop.static void free_poolstatic int sweep_cb_bufParrot_gc_sweep to perform the sweep, and free_pool to free the pool and all its arenas.
static int sweep_cb_pmcParrot_gc_sweep to perform the sweep, and free_pool to free the pool and all its arenas. Always returns 0.
void Parrot_destroy_header_poolsParrot_forall_header_pools to loop over all the pools, passing sweep_cb_pmc and sweep_cb_buf callback routines. Frees the array of sized header pointers in the Arenas structure too.
static void fix_pmc_syncsvoid Parrot_merge_header_poolssource_interp into those of dest_interp. (Used to deal with shared objects left after interpreter destruction.)
include/parrot/gc_pools.h.

Initial version by Mike Lambert on 2002.05.27.
|
|
|