Fix autoconfig and memory allocation for heavy algo.

This commit is contained in:
XMRig 2018-04-03 16:08:15 +07:00
parent 5c6ec587ac
commit 7d5a97137d
7 changed files with 42 additions and 14 deletions

View file

@ -145,7 +145,7 @@ static BOOL TrySetLockPagesPrivilege() {
}
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;
@ -154,6 +154,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;