30 #ifndef HUGE_ALLOCATOR_HXX 31 #define HUGE_ALLOCATOR_HXX 55 HugeFree(
void *p,
size_t size) noexcept;
78 VirtualFree(p, 0, MEM_RELEASE);
84 VirtualAlloc(p, size, MEM_RESET, PAGE_NOACCESS);
97 return new uint8_t[size];
103 auto *p = (uint8_t *)_p;
118 void *data =
nullptr;
128 :data(src.data), size(src.size) {
138 std::swap(data, src.data);
139 std::swap(size, src.size);
148 if (data !=
nullptr) {
154 void *
get() noexcept {
HugeAllocation(size_t _size)
Automatic huge memory allocation management.
HugeAllocation & operator=(HugeAllocation &&src) noexcept
static void HugeDiscard(void *, size_t) noexcept
HugeAllocation(HugeAllocation &&src) noexcept
static void HugeFree(void *_p, size_t) noexcept
static gcc_malloc void * HugeAllocate(size_t size)