parrotcode: Memory allocation | |
Contents | C |
src/gc/memory.c - Memory allocation
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.
PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem_sys_allocate(size_t size)
malloc
to allocate system memory.PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_allocate(size_t size, ARGIN(const char *file), int line)
PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem_sys_allocate_zeroed(size_t size)
calloc
to allocate system memory.PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_allocate_zeroed(size_t size, ARGIN(const char *file), int line)
PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__sys_realloc(NULLOK(void *from), size_t size)
PARROT_API PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__sys_realloc_zeroed(NULLOK(void *from), size_t size, size_t old_size)
PARROT_MALLOC PARROT_CANNOT_RETURN_NULL void *mem__internal_realloc(NOTNULL(void *from), size_t size, ARGIN(const char *file), int line)
PARROT_API void mem_sys_free(NULLOK(void *from))
void mem__internal_free(NULLOK(void *from), ARGIN(const char *file), int line)
void mem_setup_allocator(PARROT_INTERP)
|