1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-24 21:32:47 -05:00

RandomX: added huge-pages-jit config parameter

Set to false by default, gives 0.2% boost on Ryzen 7 3700X with 16 threads, but hashrate might be unstable on Ryzen between launches. Use with caution.
This commit is contained in:
SChernykh
2020-10-07 17:42:55 +02:00
parent a8466a139c
commit 44dcded866
23 changed files with 62 additions and 26 deletions

View File

@@ -162,9 +162,13 @@ bool xmrig::VirtualMemory::isOneGbPagesAvailable()
}
void *xmrig::VirtualMemory::allocateExecutableMemory(size_t size)
void *xmrig::VirtualMemory::allocateExecutableMemory(size_t size, bool hugePages)
{
void* result = VirtualAlloc(nullptr, align(size), MEM_COMMIT | MEM_RESERVE | MEM_LARGE_PAGES, PAGE_EXECUTE_READWRITE);
void* result = nullptr;
if (hugePages) {
result = VirtualAlloc(nullptr, align(size), MEM_COMMIT | MEM_RESERVE | MEM_LARGE_PAGES, PAGE_EXECUTE_READWRITE);
}
if (!result) {
result = VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);