diff --git a/src/Mem.cpp b/src/Mem.cpp index 85a3a832..76114745 100644 --- a/src/Mem.cpp +++ b/src/Mem.cpp @@ -41,19 +41,9 @@ MemInfo Mem::create(cryptonight_ctx **ctx, xmrig::Algo algorithm, size_t count) MemInfo info; info.size = cn_select_memory(algorithm) * count; -# ifndef XMRIG_NO_AEON - if (algorithm == xmrig::CRYPTONIGHT_LITE) { - info.size += info.size % cn_select_memory(); - } -# endif - -# ifndef XMRIG_NO_CN_PICO - if (algorithm == xmrig::CRYPTONIGHT_PICO) { - info.size = cn_select_memory(); - } -# endif - - info.pages = info.size / cn_select_memory(); + constexpr const size_t align_size = 2 * 1024 * 1024; + info.size = ((info.size + align_size - 1) / align_size) * align_size; + info.pages = info.size / align_size; allocate(info, m_enabled);