NAME ^

src/stack_common.c - Common stack handling routines for Parrot

DESCRIPTION ^

Both the register stacks and stacks implemented in src/stacks.c have a common funcionality, which is implemented in this file.

These stacks all differ only in the size of items.

Functions ^

void stack_system_init(Interp *interpreter)

Called from make_interpreter() to initialize the interpreter's register stacks.

Stack_Chunk_t *register_new_stack(Interp *interpreter, const char *name, size_t item_size)

Create a new stack and name it. stack->name is used for debugging/error reporting.

Stack_Chunk_t *cst_new_stack_chunk(Interp *interpreter, Stack_Chunk_t *)

Get a new chunk either from the freelist or allocate one.

void *stack_prepare_push(Parrot_Interp interpreter, Stack_Chunk_t **stack_p)

Return a pointer, where new entries go for push.

void *new_register_frame(Parrot_Interp interpreter, Stack_Chunk_t **stack_p)

Like above for the register frame stack. If possible get new chunk from the frame stack cache.

<void add_to_fp_cache(Interp* interpreter, Stack_Chunk_t *stack_p)>

Add a register frame to to the register frame stack cache.

void *stack_prepare_pop(Parrot_Interp interpreter, Stack_Chunk_t **stack_p)

Return a pointer, where new entries are poped off.

SEE ALSO ^

include/parrot/stacks.h, src/stacks.c, src/registers.c


parrot