Added 1GB hugepages support for Linux

This commit is contained in:
SChernykh
2019-12-05 19:39:47 +01:00
parent 7050eaa272
commit 0a5c12295d
28 changed files with 156 additions and 50 deletions

View File

@@ -53,6 +53,16 @@ void* allocLargePagesMemory(std::size_t bytes) {
}
void* allocOneGbPagesMemory(std::size_t bytes) {
void* mem = xmrig::VirtualMemory::allocateOneGbPagesMemory(bytes);
if (mem == nullptr) {
throw std::runtime_error("Failed to allocate 1GB pages memory");
}
return mem;
}
void freePagedMemory(void* ptr, std::size_t bytes) {
xmrig::VirtualMemory::freeLargePagesMemory(ptr, bytes);
}