randomx_cache and randomx_dataset changed to standard-layout structs

This commit is contained in:
tevador
2019-04-28 12:44:28 +02:00
parent fd7186f873
commit 22a3aa8d79
19 changed files with 155 additions and 173 deletions

View File

@@ -27,8 +27,7 @@ namespace randomx {
template<class Allocator, bool softAes>
void CompiledVm<Allocator, softAes>::setDataset(randomx_dataset* dataset) {
mem.memory = dataset->memory;
datasetBasePtr = dataset->memory;
datasetPtr = dataset;
}
template<class Allocator, bool softAes>
@@ -36,7 +35,7 @@ namespace randomx {
VmBase<Allocator, softAes>::generateProgram(seed);
randomx_vm::initialize();
compiler.generateProgram(program, config);
mem.memory = datasetBasePtr + datasetOffset;
mem.memory = datasetPtr->memory + datasetOffset;
execute();
}