Proctal

Documentation

API memory management

The API makes calls to malloc and free to allocate and deallocate memory, respectively, for its internal data structures.
If you're the kind of programmer that wants to have complete control over every memory allocation, you can provide your own versions of malloc and free.
Here's how you would tell the API to use your custom malloc and free:

void *my_malloc(size_t size)
{
	// Allocate memory however you like.
}

void my_free(void *memory)
{
	// Deallocate your chunk of memory.
}

proctal_malloc_set(&my_malloc);
proctal_free_set(&my_free);

Just make sure that you do this before calling any other function of the API. You wouldn't want your version of free being called with an address returned by the wrong malloc.