Add memory to cryptonight_ctx.

This commit is contained in:
XMRig 2017-04-21 11:56:11 +03:00
parent f29d05bdde
commit 8ab4c1c8bd
13 changed files with 85 additions and 81 deletions

View file

@ -24,6 +24,7 @@
#include <string.h>
#include "persistent_memory.h"
#include "algo/cryptonight/cryptonight.h"
static size_t offset = 0;
@ -36,3 +37,11 @@ void * persistent_calloc(size_t num, size_t size) {
return mem;
}
void * create_persistent_ctx(int thr_id) {
struct cryptonight_ctx *ctx = (struct cryptonight_ctx *) &persistent_memory[MEMORY - sizeof(struct cryptonight_ctx) * (thr_id + 1)];
ctx->memory = &persistent_memory[MEMORY * (thr_id + 1)];
return ctx;
}