Added option --no-huge-pages.

This commit is contained in:
XMRig 2017-08-16 14:21:12 +03:00
parent 27f02d5f9f
commit 8bba0df054
6 changed files with 28 additions and 5 deletions

View file

@ -33,7 +33,7 @@
#include "Options.h"
bool Mem::allocate(int algo, int threads, bool doubleHash)
bool Mem::allocate(int algo, int threads, bool doubleHash, bool enabled)
{
m_algo = algo;
m_threads = threads;
@ -42,6 +42,11 @@ bool Mem::allocate(int algo, int threads, bool doubleHash)
const int ratio = (doubleHash && algo != Options::ALGO_CRYPTONIGHT_LITE) ? 2 : 1;
const size_t size = MEMORY * (threads * ratio + 1);
if (!enabled) {
m_memory = static_cast<uint8_t*>(_mm_malloc(size, 16));
return true;
}
m_flags |= HugepagesAvailable;
# if defined(__APPLE__)