NAME ^

src/gc/memory.c - Memory allocation

DESCRIPTION ^

The memory (mem) API handles memory allocation,

Basically just a wrapper around malloc/calloc/realloc/free() with an setup function to initialize the memory pools.

Functions ^

PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem_sys_allocate(size_t size)

Uses malloc to allocate system memory.

PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_allocate(size_t size, NOTNULL(const char *file), int line)

TODO: Not yet documented!!!

PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem_sys_allocate_zeroed(size_t size)

Uses calloc to allocate system memory.

PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_allocate_zeroed(size_t size, NOTNULL(const char *file), int line)

TODO: Not yet documented!!!

PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__sys_realloc(NULLOK(void *from), size_t size)

Resize a chunk of system memory.

PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__sys_realloc_zeroed(NULLOK(void *from), size_t size, size_t old_size)

Resize a chunk of system memory. Fill the newly allocated space with zeroes.

PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_realloc(NOTNULL(void *from), size_t size, NOTNULL(const char *file), int line)

TODO: Not yet documented!!!

PARROT_API void mem_sys_free(NULLOK(void *from))

Free a chunk of memory back to the system.

void mem__internal_free(NULLOK(void *from), NOTNULL(const char *file), int line)

TODO: Not yet documented!!!

void mem_setup_allocator(PARROT_INTERP)

Initializes the allocator.


parrot