mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-10 01:02:40 -05:00
Added option --no-huge-pages.
This commit is contained in:
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user