42 void *
Alloc(
size_t num_blks,
bool fill =
false);
67 static int RequestMemSize(
size_t blk_size,
size_t num_blks,
bool page_aligned =
true);
78 static vector<vector<_mem_allocation_t>> _mem_regions;
79 static vector<size_t> _mem_region_sizes;
80 static vector<unsigned char *> _blks;
82 static size_t _mem_size_max_req;
83 static bool _page_aligned_req;
84 static size_t _blk_size_req;
86 static size_t _mem_size_max;
87 static bool _page_aligned;
88 static size_t _blk_size;
90 static int _ref_count;
92 static int _Reinit(
size_t n);
The Wasp BlkMemMgr class.
static int RequestMemSize(size_t blk_size, size_t num_blks, bool page_aligned=true)
Set the size of the memory pool used by the memory allocator.
BlkMemMgr()
Initialize a memory allocator.
static size_t GetBlkSize()
void FreeMem(void *ptr)
Free memory.
void * Alloc(size_t num_blks, bool fill=false)
Alloc space from memory pool.