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

@@ -333,7 +333,11 @@ extern "C" {
try {
dataset = new randomx_dataset();
if (flags & RANDOMX_FLAG_LARGE_PAGES) {
if (flags & RANDOMX_FLAG_1GB_PAGES) {
dataset->dealloc = &randomx::deallocDataset<randomx::OneGbPageAllocator>;
dataset->memory = (uint8_t*)randomx::OneGbPageAllocator::allocMemory(RANDOMX_DATASET_MAX_SIZE);
}
else if (flags & RANDOMX_FLAG_LARGE_PAGES) {
dataset->dealloc = &randomx::deallocDataset<randomx::LargePageAllocator>;
dataset->memory = (uint8_t*)randomx::LargePageAllocator::allocMemory(RANDOMX_DATASET_MAX_SIZE);
}