hardikp / cpp-mempool

C++ header-only mempool library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

C++ header-only mempool library

License:MIT License


Languages

Language:C++ 99.9%Language:CMake 0.1%