Added "memory-pool" option.

This commit is contained in:
XMRig 2019-10-07 23:38:01 +07:00
parent c4170fbb86
commit 9dce868fb9
5 changed files with 32 additions and 9 deletions

View file

@ -110,7 +110,7 @@ void xmrig::VirtualMemory::destroy()
}
void xmrig::VirtualMemory::init(bool hugePages, int poolSize)
void xmrig::VirtualMemory::init(size_t poolSize, bool hugePages)
{
if (!pool) {
osInit();
@ -118,10 +118,10 @@ void xmrig::VirtualMemory::init(bool hugePages, int poolSize)
# ifdef XMRIG_FEATURE_HWLOC
if (Cpu::info()->nodes() > 1) {
pool = new NUMAMemoryPool(align(poolSize < 0 ? Cpu::info()->threads() : poolSize, Cpu::info()->nodes()), hugePages);
pool = new NUMAMemoryPool(align(poolSize, Cpu::info()->nodes()), hugePages);
} else
# endif
{
pool = new MemoryPool(poolSize < 0 ? Cpu::info()->threads() : poolSize, hugePages);
pool = new MemoryPool(poolSize, hugePages);
}
}