26 : size_limit_(size_limit), size_(0) {
28 auto pmem_space_info = std::filesystem::space(
g_pmem_path.c_str(), ec);
30 <<
"error code: " << ec <<
"\n";
31 size_t capacity = pmem_space_info.capacity;
33 <<
g_pmem_path <<
" is not recognized as a direct-access pmem path.";
35 <<
g_pmem_path <<
" is not large enough for the requested PMem space";
37 <<
"Failed to create PMEM memory.";
39 <<
" with capacity " << capacity <<
"\n";
52 auto ret = memkind_malloc(
pmem_kind_, num_bytes);
60 std::memset(ret, 0, num_bytes);
PMemArena(size_t min_block_size=1ULL<< 32, size_t size_limit=0)
void * allocate(const size_t num_bytes) override
size_t totalBytes() const override
size_t bytesUsed() const override
std::vector< std::pair< void *, size_t > > allocations_
struct memkind * pmem_kind_
void * allocateAndZero(const size_t num_bytes) override