Implemented RxNUMAStorage.

This commit is contained in:
XMRig 2019-10-05 08:24:28 +07:00
parent ad6dc876b3
commit 05928ccc25
9 changed files with 306 additions and 61 deletions

View file

@ -25,8 +25,9 @@
*/
#include "crypto/randomx/randomx.h"
#include "crypto/rx/RxCache.h"
#include "crypto/common/VirtualMemory.h"
#include "crypto/randomx/randomx.h"
static_assert(RANDOMX_FLAG_JIT == 8, "RANDOMX_FLAG_JIT flag mismatch");
@ -72,3 +73,17 @@ bool xmrig::RxCache::init(const Buffer &seed)
return true;
}
std::pair<uint32_t, uint32_t> xmrig::RxCache::hugePages() const
{
constexpr size_t twoMiB = 2u * 1024u * 1024u;
constexpr size_t total = VirtualMemory::align(maxSize(), twoMiB) / twoMiB;
uint32_t count = 0;
if (isHugePages()) {
count += total;
}
return { count, total };
}