Remove calls to heapsize (#10432)
* update memorydb trait * use malloc_size_of instead of heapsize_of * use jemalloc as default allocator for parity client.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
use hash::KECCAK_EMPTY;
|
||||
use heapsize::HeapSizeOf;
|
||||
use parity_util_mem::{MallocSizeOf, MallocSizeOfOps};
|
||||
use ethereum_types::H256;
|
||||
use parking_lot::Mutex;
|
||||
use memory_cache::MemoryLruCache;
|
||||
@@ -25,11 +25,12 @@ use super::super::instructions::{self, Instruction};
|
||||
|
||||
const DEFAULT_CACHE_SIZE: usize = 4 * 1024 * 1024;
|
||||
|
||||
// stub for a HeapSizeOf implementation.
|
||||
/// Stub for a sharing `BitSet` data in cache (reference counted)
|
||||
/// and implementing MallocSizeOf on it.
|
||||
struct Bits(Arc<BitSet>);
|
||||
|
||||
impl HeapSizeOf for Bits {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
impl MallocSizeOf for Bits {
|
||||
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
||||
// dealing in bits here
|
||||
self.0.capacity() * 8
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user