NAME ^

src/resources.c - Handling Small Object Pools

DESCRIPTION ^

Handles the accessing of small object pools (header pools).

Functions ^

INTVAL contained_in_pool(Interp *interp, Small_Object_Pool *pool, void *ptr)

Returns whether pool contains *ptr.

int Parrot_is_const_pmc(Parrot_Interp interp, PMC *pmc)

Returns whether *pmc is a constant PMC.

void more_traceable_objects(Interp *interp, Small_Object_Pool *pool)

We're out of traceable objects. Try a DOD, then get some more if needed.

static void gc_ms_add_free_object(Interp *interp, Small_Object_Pool *pool, void *to_add)

Add an unused object back to the free pool for later reuse.

static void *gc_ms_get_free_object(Interp *interp, Small_Object_Pool *pool)

Get a new object from the free pool and return it.

void Parrot_add_to_free_list(Interp *interp, Small_Object_Pool *pool, Small_Object_Arena *arena, UINTVAL start, UINTVAL end)

Adds the memory between start and end to the free list.

static void gc_ms_alloc_objects(Interp *interp, Small_Object_Pool *pool)

We have no more headers on the free header pool. Go allocate more and put them on.

Small_Object_Pool *new_small_object_pool(Interp *interp, size_t object_size, size_t objects_per_alloc)

Creates a new Small_Object_Pool and returns a pointer to it.

void Parrot_gc_ms_init(Interp *interp)

Initialize the state structures of the gc system. Called immediately before creation of memory pools. This function must set the function pointers for add_free_object_fn, get_free_object_fn, alloc_object_fn, and more_object_fn.

void Parrot_small_object_pool_merge(Interp *interp, Small_Object_Pool *dest, Small_Object_Pool *source)

Merge source into dest.

SEE ALSO ^

include/parrot/smallobject.h, docs/memory_internals.pod.


parrot