tcp_malloc(3) z88dk Programmer's Manual tcp_malloc(3)
tcp_calloc, tcp_malloc, tcp_free - Allocate and free memory
void *tcp_calloc(size_t nmemb, size_t size);
void *tcp_malloc(size_t size);
void tcp_free(void *ptr);
calloc() allocates memory for an array of nmemb elements of size bytes
each and returns a pointer to the allocated memory. The memory is set
malloc() allocates size bytes and returns a pointer to the allocated
memory. The memory is not cleared.
free() frees the memory space pointed to by ptr, which must have been
returned by a previous call to malloc() or calloc() Otherwise, or if
free(ptr) has already been called before, undefined behaviour occurs.
If ptr is NULL, no operation is performed.
For calloc() and malloc(), the value returned is a pointer to the allo‐
cated memory, which is suitably aligned for any kind of variable, or
NULL if the request fails.
free() returns no value.
These functions manipulate memory in a private memory page belonging to
ZSock. This 16k page holds all the buffers that ZSock uses and hence
requests for large amounts of memory are likely to fail (and in any
case are not recommended).
This facility has been offered to allow daemons to be written simply
(they have no address space of their own). User applications should not
use these facilities. If a large (>256 bytes) amount of memory is
required for a user application then the application should either be
of the BAD type or be redesigned.
Dominic Morris <firstname.lastname@example.org>
February 18 2000 tcp_malloc(3)