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.