MyAlloc memory management module.

The MyAlloc memory management module is to help the programmer to avoid crating memory leaking applications. When allocating dynamic memory via malloc you have to release it using free. Old programs do not care too much about freeing the memory as the task was done by the operating system, whenever the process ended. Nowadays single process, multithread applications should release memory.

Using the package MyAlloc you first create a memory segment. A memory segment is a logical entity. Whenever you allocate a new piece of memory you have to specify what memory segment you want to use for it. MyAlloc does not preallocate memory, just keeps track of the memory pieces that were allocated for the segment. Whenever you want to get rid of all memories allocated for a segment you can release them all with a single function call without calling free for each malloced memory piece.

You can release memory segments, merge them together, release memory pieces allocated to a segment and so on.

The module is GNU LGPL and is part of the ScriptBasic interpreter package.

For further information visit the ScriptBasic home page and read the Developers' Guide detailing all the modules.