Implement low power mode (double hash).
This commit is contained in:
parent
caf7cda1d5
commit
1678dc1d6d
18 changed files with 686 additions and 390 deletions
5
memory.c
5
memory.c
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "persistent_memory.h"
|
||||
#include "algo/cryptonight/cryptonight.h"
|
||||
#include "options.h"
|
||||
|
||||
static size_t offset = 0;
|
||||
|
||||
|
@ -41,7 +42,9 @@ void * persistent_calloc(size_t num, size_t size) {
|
|||
|
||||
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)];
|
||||
|
||||
const int ratio = opt_double_hash ? 2 : 1;
|
||||
ctx->memory = &persistent_memory[MEMORY * (thr_id * ratio + 1)];
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue