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 functionality, which is implemented in this file.

These stacks all differ only in the size of items.

Functions ^

PARROT_API void stack_system_init(SHIM_INTERP)

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

PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL Stack_Chunk_t *register_new_stack(PARROT_INTERP, NOTNULL(const char *name), size_t item_size)

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

PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL Stack_Chunk_t *cst_new_stack_chunk(PARROT_INTERP, NOTNULL(const Stack_Chunk_t *chunk))

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

PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL void *stack_prepare_push(PARROT_INTERP, NOTNULL(Stack_Chunk_t **stack_p))

Return a pointer, where new entries go for push.

PARROT_API PARROT_WARN_UNUSED_RESULT PARROT_CANNOT_RETURN_NULL void *stack_prepare_pop(PARROT_INTERP, NOTNULL(Stack_Chunk_t **stack_p))

Return a pointer, where new entries are popped off.

SEE ALSO ^

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


parrot