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:
cheme
2019-06-19 13:54:05 +02:00
committed by GitHub
parent 859a41308c
commit 6fc5014b4d
84 changed files with 926 additions and 1074 deletions

View File

@@ -20,7 +20,7 @@
use std::collections::{HashSet, VecDeque};
use std::cmp;
use heapsize::HeapSizeOf;
use parity_util_mem::MallocSizeOf;
use ethereum_types::H256;
use rlp::{self, Rlp};
use types::BlockNumber;
@@ -60,7 +60,7 @@ macro_rules! debug_sync {
};
}
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Debug, MallocSizeOf)]
/// Downloader state
pub enum State {
/// No active downloads.
@@ -113,6 +113,7 @@ impl From<rlp::DecoderError> for BlockDownloaderImportError {
/// Block downloader strategy.
/// Manages state and block data for a block download process.
#[derive(MallocSizeOf)]
pub struct BlockDownloader {
/// Which set of blocks to download
block_set: BlockSet,
@@ -223,11 +224,6 @@ impl BlockDownloader {
self.state = State::Blocks;
}
/// Returns used heap memory size.
pub fn heap_size(&self) -> usize {
self.blocks.heap_size() + self.round_parents.heap_size_of_children()
}
/// Returns best imported block number.
pub fn last_imported_block_number(&self) -> BlockNumber {
self.last_imported_block