From 622632616c48431314e707e613cf1f8e5f70ee2f Mon Sep 17 00:00:00 2001 From: Hawstein Date: Mon, 28 Aug 2017 15:19:04 +0800 Subject: [PATCH] fix bloom bitvecjournal storage allocation (#6390) --- util/bloom/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/bloom/src/lib.rs b/util/bloom/src/lib.rs index 16e0e5368..91897ed44 100644 --- a/util/bloom/src/lib.rs +++ b/util/bloom/src/lib.rs @@ -37,9 +37,9 @@ struct BitVecJournal { impl BitVecJournal { pub fn new(size: usize) -> BitVecJournal { - let extra = if size % 8 > 0 { 1 } else { 0 }; + let extra = if size % 64 > 0 { 1 } else { 0 }; BitVecJournal { - elems: vec![0u64; size / 8 + extra], + elems: vec![0u64; size / 64 + extra], journal: HashSet::new(), } }