C.malloc(size: num) -> ptr
Allocate memory block
size
Size of memory block, in bytes.
On success, a pointer to the memory block allocated by the function.
If size is zero or the function failed to allocate the requested block of memory, null is returned.
C.calloc(count: num, size: num) -> ptr
Allocate and zero-initialize array
count
Number of elements to allocate.
size
Size of each element.
Like C.malloc, but the returned memory block is zero-initialized.
C.realloc(addr: ptr, size: num) -> ptr
Reallocate memory block
addr
Pointer to a memory block previously allocated with C.malloc, C.calloc or C.realloc.
If this is a null pointer, the function works like C.malloc.
size
New size for the memory block, in bytes.
See C.malloc.
C.free(addr: ptr)
Deallocate memory block
addr
A block of memory previously allocated by a call to C.malloc, C.calloc or C.realloc is deallocated, making it available again for further allocations.
None.
Do not free any pointer is freed or not formed by malloc, calloc and realloc.