From 1cf76fa97638d1f78ccacb91fc5be21eb9b25529 Mon Sep 17 00:00:00 2001 From: tromp Date: Tue, 18 Oct 2016 22:07:54 -0400 Subject: [PATCH] save lotsa memory --- equi_miner.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/equi_miner.h b/equi_miner.h index 3ddd5fc..97cf188 100644 --- a/equi_miner.h +++ b/equi_miner.h @@ -41,16 +41,28 @@ typedef u32 au32; // 2_log of number of buckets #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 static const u32 NBUCKETS = 1<