save lotsa memory
This commit is contained in:
parent
2fed4d202f
commit
1cf76fa976
16
equi_miner.h
16
equi_miner.h
|
@ -41,16 +41,28 @@ typedef u32 au32;
|
||||||
// 2_log of number of buckets
|
// 2_log of number of buckets
|
||||||
#define BUCKBITS (DIGITBITS-RESTBITS)
|
#define BUCKBITS (DIGITBITS-RESTBITS)
|
||||||
|
|
||||||
|
#ifndef SAVEMEM
|
||||||
|
#if RESTBITS == 4
|
||||||
|
// can't save memory in such small buckets
|
||||||
|
#define SAVEMEM 1
|
||||||
|
#elif RESTBITS >= 8
|
||||||
|
// take advantage of law of large numbers (sum of 2^8 random numbers)
|
||||||
|
// this reduces (200,9) memory to under 144MB, with negligible discarding
|
||||||
|
#define SAVEMEM 9/14
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// number of buckets
|
// number of buckets
|
||||||
static const u32 NBUCKETS = 1<<BUCKBITS;
|
static const u32 NBUCKETS = 1<<BUCKBITS;
|
||||||
// 2_log of number of slots per bucket
|
// 2_log of number of slots per bucket
|
||||||
static const u32 SLOTBITS = RESTBITS+1+1;
|
static const u32 SLOTBITS = RESTBITS+1+1;
|
||||||
|
static const u32 SLOTRANGE = 1<<SLOTBITS;
|
||||||
// number of slots per bucket
|
// number of slots per bucket
|
||||||
static const u32 NSLOTS = 1<<SLOTBITS;
|
static const u32 NSLOTS = SLOTRANGE * SAVEMEM;
|
||||||
// number of per-xhash slots
|
// number of per-xhash slots
|
||||||
static const u32 XFULL = 16;
|
static const u32 XFULL = 16;
|
||||||
// SLOTBITS mask
|
// SLOTBITS mask
|
||||||
static const u32 SLOTMASK = NSLOTS-1;
|
static const u32 SLOTMASK = SLOTRANGE-1;
|
||||||
// number of possible values of xhash (rest of n) bits
|
// number of possible values of xhash (rest of n) bits
|
||||||
static const u32 NRESTS = 1<<RESTBITS;
|
static const u32 NRESTS = 1<<RESTBITS;
|
||||||
// number of blocks of hashes extracted from single 512 bit blake2b output
|
// number of blocks of hashes extracted from single 512 bit blake2b output
|
||||||
|
|
Loading…
Reference in New Issue