Skip to content

Commit

Permalink
ensure partial cache size is at most the full cache size
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 15, 2020
1 parent 28656df commit 9c05fd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage-proofs/porep/src/stacked/vanilla/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ where
// Number of nodes to be cached in memory
const DEFAULT_CACHE_SIZE: u32 = 2048;
let cache_entries = self.size() as u32;
let cache_size = cache_entries.min(DEFAULT_CACHE_SIZE);

info!("using parent_cache[{}]", cache_entries);
info!("using parent_cache[{} / {}]", cache_size, cache_entries);

ParentCache::new(DEFAULT_CACHE_SIZE, cache_entries, self)
ParentCache::new(cache_size, cache_entries, self)
}

pub fn copy_parents_data_exp(
Expand Down

0 comments on commit 9c05fd0

Please sign in to comment.