NAME ^

src/resources.c - Handling Small Object Pools

DESCRIPTION ^

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

Functions ^

INTVAL contained_in_pool(Interp *interpreter, struct Small_Object_Pool *pool, void *ptr)

Returns whether pool contains *ptr.

int Parrot_is_const_pmc(Parrot_Interp interpreter, PMC *pmc)

Returns whether *pmc is a constant PMC.

void more_traceable_objects(Interp *interpreter, struct 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 *interpreter, struct 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 *interpreter, struct Small_Object_Pool *pool)

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

void Parrot_add_to_free_list(Interp *interpreter, struct Small_Object_Pool *pool, struct 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 *interpreter, struct Small_Object_Pool *pool)

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

struct Small_Object_Pool *new_small_object_pool(Interp *interpreter, 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 *interpreter)

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.

SEE ALSO ^

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


parrot