You can override the default memory management routines by defining replacements and including them in the link command prior to libkarel. If you do decide to override the memory management routines, they must all be redefined. It is not possible to redefine some memory management routines and not others.
The default implementation uses the standard C library calls
calloc
, malloc
, free
, and realloc
.
ktr_calloc
, ktr_malloc
,
or ktr_realloc
.
malloc(
size)
. If size is equal to zero, the
call is equivalent to free(
ptr)
. Unless ptr
is NULL, it must have been allocated by a previous call to
ktr_calloc
or ktr_malloc
. Returns a pointer to the new
block of memory. If the allocation fails, NULL is returned and the
original block of memory is untouched.
Go to the first, previous, next, last section, table of contents.