Added classes Rx, RxAlgo, RxCache, RxDataset.

This commit is contained in:
XMRig 2019-07-10 01:53:05 +07:00
parent ea1149a971
commit f42adafee0
18 changed files with 704 additions and 144 deletions

View file

@ -32,6 +32,7 @@
#include "crypto/cn/CnAlgo.h"
#include "crypto/common/Algorithm.h"
#include "crypto/rx/RxAlgo.h"
#include "rapidjson/document.h"
@ -138,12 +139,12 @@ size_t xmrig::Algorithm::memory() const
}
# ifdef XMRIG_ALGO_RANDOMX
if (m_id == RX_WOW) {
return 0x100000;
if (f == RANDOM_X) {
return RxAlgo::l3(m_id);
}
# endif
return 0x200000;
return 0;
}

View file

@ -44,6 +44,8 @@ public:
static void freeLargePagesMemory(void *p, size_t size);
static void protectExecutableMemory(void *p, size_t size);
static void unprotectExecutableMemory(void *p, size_t size);
static inline constexpr size_t align(size_t pos, size_t align = 2097152) { return ((pos - 1) / align + 1) * align; }
};

View file

@ -32,15 +32,6 @@
#include "crypto/common/VirtualMemory.h"
namespace xmrig {
constexpr size_t align(size_t pos, size_t align) {
return ((pos - 1) / align + 1) * align;
}
}
void *xmrig::VirtualMemory::allocateExecutableMemory(size_t size)
{
return VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);