| parrotcode: Handling Small Object Pools | |
| Contents | C |

src/gc/resources.c - Handling Small Object Pools

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

INTVAL contained_in_pool*ptr points to a location in pool.int Parrot_is_const_pmc*pmc is a constant PMC.
The given pointer is a constant PMC if it points into the constant PMC pool.static void more_traceable_objectsstatic void gc_ms_add_free_pmc_extstatic void gc_ms_add_free_objectstatic void *gc_ms_get_free_objectgc_ms_add_free_object to either free them up with a DOD run,
or allocate new objects.
If there are objects available on the free list,
pop it off and return it.static void *gc_ms_get_free_pmc_extvoid Parrot_add_to_free_listarena to the free list.void Parrot_append_arena_in_poolstatic void gc_ms_alloc_objectsSmall_Object_Pool *new_small_object_poolSmall_Object_Pool and returns a pointer to it.
Initializes the pool structure based on the size of objects in the pool and the number of items to allocate in each arena.void gc_pmc_ext_pool_initstatic void gc_ms_pool_initvoid Parrot_gc_ms_initadd_free_object_fn,
get_free_object_fn,
alloc_object_fn,
and more_object_fn.void Parrot_small_object_pool_mergesource into pool dest.
Combines the free lists directly,
moves all arenas to the new pool,
and remove the old pool.
To merge,
the two pools must have the same object size,
and the same name (if they have names).
include/parrot/smallobject.h, docs/memory_internals.pod.
|
|
|