Try to allocate scratchpad from dataset's 1 GB huge pages, if normal huge pages are not available

This commit is contained in:
SChernykh 2020-07-31 13:37:22 +02:00
parent 838cc08680
commit abb78302b8
5 changed files with 37 additions and 1 deletions

View file

@ -51,6 +51,7 @@ static std::mutex mutex;
xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages, bool usePool, uint32_t node, size_t alignSize) :
m_size(align(size)),
m_capacity(m_size),
m_node(node)
{
if (usePool) {
@ -69,6 +70,7 @@ xmrig::VirtualMemory::VirtualMemory(size_t size, bool hugePages, bool oneGbPages
}
if (oneGbPages && allocateOneGbPagesMemory()) {
m_capacity = align(size, 1ULL << 30);
return;
}