Skip to content

hardikp/cpp-mempool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

cpp-mempool

C++ header-only mempool library

Examples

#include <mempool.h>

int main(int argc, char** argv) {
  unsigned capacity = 1024;
  MemPool<int> pool(capacity);

  for (auto i = 0u; i < capacity * 2; i++) {
    int *location = pool.allocate();
  }
}

Notes

  • MemPool is not thread-safe. If you're trying to use a single memory pool from multiple threads, it can create race conditions.

Releases

No releases published

Packages

No packages published