Local Memory: 3.3 Using Local Memory Heaps: Contracting the LMem Heap

Up: GEOS SDK TechDocs | Up | Prev: 3.2 Using Chunks | Next: 3.4 Example of LMem Usage
LMemContract()

The local memory manager routines ordinarily take care of heap compaction. However, you can also order compaction at will.

The routine LMemContract() compacts the heap and then frees all the unused heap space (by truncating the block with the LMem heap). The routine takes one argument, namely the handle of the (locked or fixed) block containing the LMem heap. It shuffles all the chunks, thus invalidating pointers to chunks; however, it is guaranteed not to move the block on the global heap.


Up: GEOS SDK TechDocs | Up | Prev: 3.2 Using Chunks | Next: 3.4 Example of LMem Usage