Added class NUMAMemoryPool.

This commit is contained in:
XMRig
2019-10-07 20:39:04 +07:00
parent 78d87138d5
commit d7ae457325
5 changed files with 199 additions and 6 deletions

View File

@@ -32,6 +32,11 @@
#include "crypto/common/portable/mm_malloc.h"
#ifdef XMRIG_FEATURE_HWLOC
# include "crypto/common/NUMAMemoryPool.h"
#endif
#include <cinttypes>
#include <mutex>
@@ -111,5 +116,12 @@ void xmrig::VirtualMemory::init(bool hugePages, int poolSize)
osInit();
}
pool = new MemoryPool(poolSize < 0 ? Cpu::info()->threads() : poolSize, hugePages);
# ifdef XMRIG_FEATURE_HWLOC
if (Cpu::info()->nodes() > 1) {
pool = new NUMAMemoryPool(align(poolSize < 0 ? Cpu::info()->threads() : poolSize, Cpu::info()->nodes()), hugePages);
} else
# endif
{
pool = new MemoryPool(poolSize < 0 ? Cpu::info()->threads() : poolSize, hugePages);
}
}