wiki:MemManage

Version 2 (modified by cameron, 11 years ago) (diff)

--

Memory Management Architecture

The Parabix memory management architecture is designed to allow highly efficient management and use of memory from a variety of perspectives.

  1. Streaming Buffers
  2. Coterminal String Pools
  3. Depth-indexed DOM

Coterminal String Pools

A Coterminal String Pool is an efficient managed storage space for strings that are to be maintained until a common time of destruction. That is, each string is maintained without the possibility of individual deallocation until such time as the entire pool is destroyed.

The Coterminal String Pool avoids the memory management overhead (free list maintenance, block merging) and memory fragmentation that result from individual string allocation and deallocation with new and delete. Because the strings are maintained in a coterminal fashion, the associated space may be returned to the system as a single block when the pool itself is deallocated.

Statically-Allocated Initial Buffer

The Coterminal String Pool is designed to use a statically allocated initial buffer of a size specified by a template parameter. This buffer is allocated at the same time as, and as part of, the pool object itself. This is particularly useful for efficient cost-free allocation and deallocation if pool objects are allocated on the stack.