27 void* addr = mmap(
nullptr, size, PROT_READ | PROT_WRITE,
28 MAP_SHARED | MAP_ANONYMOUS, -1, 0);
29 if (addr == MAP_FAILED) {
33 this->m_length = size;
43 int stat = munmap(ptr, this->m_length);
PlatformUIntType NATIVE_UINT_TYPE
A MemAllocator implementation class that uses mmap.
void deallocate(const NATIVE_UINT_TYPE identifier, void *ptr)
virtual ~MmapAllocator()
Destructor with no arguments.
void * allocate(const NATIVE_UINT_TYPE identifier, NATIVE_UINT_TYPE &size, bool &recoverable)