talloc-like pools for C++

405 views Asked by At

Is there any memory allocation library that provides talloc-like pools and is specifically designed to play well with C++'s features?

In particular:

  1. I can predict in advance how big a pool needs to be. There is no risk that I might accidentally overflow it.

  2. If I allocate an object in a pool, I will not need to reclaim its storage until the whole pool is deallocated. (So objects can simply be sequentially allocated in the pool, causing no more waste than the insertion of padding to account for the alignments of different types.)

  3. I need the ability to allocate objects of various sizes and alignments in a single pool.

  4. I need to store the elements of standard library containers in pools. (In the particular case of std::vectors, I will set the capacity of the internal buffer at construction time, and then I will not attempt to further grow the vector.)

What I do not want to do is:

  1. Reinvent destructors.
  2. Reinvent exceptions.
  3. Reinvent standard library containers.
  4. Use void *.
0

There are 0 answers