Next: , Previous: Ferret Strings, Up: Ferret C Libraries


3.5 Memory De/Allocation

Ferret implement generic de/allocation routines to be used instead of the plain and system-dependent malloc and free routines.

It is very encourage to the Ferret Hacker to use these routines instead of the plain ones. These routines are aware of the actual state of the Tcl interpreter and other Ferret specific state.

— Function: char *ferret_alloc (size)

Allocates memory. If there is not memory, signal a fatal error.

The function returns a pointer to the newly allocated memory.

— Function: void ferret_dealloc (ptr)

Deallocates memory. Memory pointed by ptr must have been allocated with ferret_alloc.