mirror of
https://github.com/xmrig/xmrig.git
synced 2026-02-02 02:03:03 -05:00
Fix autoconfig and memory allocation for heavy algo.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
#include "xmrig.h"
|
||||
|
||||
|
||||
bool Mem::allocate(int algo, int threads, bool doubleHash, bool enabled)
|
||||
bool Mem::allocate(xmrig::Algo algo, int threads, bool doubleHash, bool enabled)
|
||||
{
|
||||
m_algo = algo;
|
||||
m_threads = threads;
|
||||
@@ -49,6 +49,10 @@ bool Mem::allocate(int algo, int threads, bool doubleHash, bool enabled)
|
||||
const int ratio = (doubleHash && algo != xmrig::CRYPTONIGHT_LITE) ? 2 : 1;
|
||||
m_size = MONERO_MEMORY * (threads * ratio + 1);
|
||||
|
||||
if (algo == xmrig::CRYPTONIGHT_HEAVY) {
|
||||
m_size *= 2;
|
||||
}
|
||||
|
||||
if (!enabled) {
|
||||
m_memory = static_cast<uint8_t*>(_mm_malloc(m_size, 16));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user