RandomX JIT refactoring
- Smaller memory footprint - A bit faster overall
This commit is contained in:
parent
92810ad761
commit
abb3340cc7
9 changed files with 374 additions and 428 deletions
|
@ -93,7 +93,7 @@ template<size_t N>
|
|||
xmrig::CpuWorker<N>::~CpuWorker()
|
||||
{
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
delete m_vm;
|
||||
RxVm::Destroy(m_vm);
|
||||
# endif
|
||||
|
||||
CnCtx::release(m_ctx, N);
|
||||
|
@ -118,7 +118,7 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
|||
}
|
||||
|
||||
if (!m_vm) {
|
||||
m_vm = new RxVm(dataset, m_memory->scratchpad(), !m_hwAES, m_assembly, m_node);
|
||||
m_vm = RxVm::Create(dataset, m_memory->scratchpad(), !m_hwAES, m_assembly, m_node);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -249,14 +249,14 @@ void xmrig::CpuWorker<N>::start()
|
|||
if (job.algorithm().family() == Algorithm::RANDOM_X) {
|
||||
if (first) {
|
||||
first = false;
|
||||
randomx_calculate_hash_first(m_vm->get(), tempHash, m_job.blob(), job.size());
|
||||
randomx_calculate_hash_first(m_vm, tempHash, m_job.blob(), job.size());
|
||||
}
|
||||
|
||||
if (!nextRound(m_job)) {
|
||||
break;
|
||||
}
|
||||
|
||||
randomx_calculate_hash_next(m_vm->get(), tempHash, m_job.blob(), job.size(), m_hash);
|
||||
randomx_calculate_hash_next(m_vm, tempHash, m_job.blob(), job.size(), m_hash);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue