Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Update to latest trie version. #10972

Merged
merged 20 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update parity-util-mem.
  • Loading branch information
cheme committed Aug 14, 2019
commit 4bc0f14defd92eaba7f1453ce72c97ee1ccb860a
51 changes: 15 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ethcore-secretstore = { path = "secret-store", optional = true }

registrar = { path = "util/registrar" }

parity-util-mem = { version = "0.1", features = ["jemalloc-global"] }
parity-util-mem = { version = "0.2.0", features = ["jemalloc-global"] }

[build-dependencies]
rustc_version = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion ethcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ evm = { path = "evm" }
trie-vm-factories = { path = "trie-vm-factories" }
futures = "0.1"
hash-db = "0.15.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
itertools = "0.5"
journaldb = { path = "../util/journaldb" }
keccak-hash = "0.2.0"
Expand Down
2 changes: 1 addition & 1 deletion ethcore/account-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ log = "0.4"
lru-cache = "0.1.2"
memory-db = "0.15.0"
parity-bytes = "0.1.0"
parity-util-mem = "0.1.0"
parity-util-mem = "0.2.0"
parking_lot = "0.8.0"
pod = { path = "../pod" }
rlp = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion ethcore/blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ common-types = { path = "../types" }
ethcore-db = { path = "../db" }
ethereum-types = "0.6.0"
keccak-hash = "0.2.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
itertools = "0.5"
kvdb = "0.1"
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion ethcore/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"
common-types = { path = "../types" }
ethereum-types = "0.6.0"
kvdb = "0.1"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
parking_lot = "0.8"
rlp = "0.4.0"
rlp_derive = { path = "../../util/rlp-derive" }
2 changes: 1 addition & 1 deletion ethcore/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
bit-set = "0.4"
parity-bytes = "0.1"
ethereum-types = "0.6.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
lazy_static = "1.0"
log = "0.4"
vm = { path = "../vm" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/light/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ethcore-network = { path = "../../util/network" }
ethcore-miner = { path = "../../miner" }
ethcore-io = { path = "../../util/io" }
hash-db = "0.15.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
vm = { path = "../vm" }
fastmap = { path = "../../util/fastmap" }
failsafe = { version = "0.3.0", default-features = false, features = ["parking_lot_mutex"] }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/private-tx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ethjson = { path = "../../json" }
ethkey = { path = "../../accounts/ethkey" }
fetch = { path = "../../util/fetch" }
futures = "0.1"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
keccak-hash = "0.2.0"
log = "0.4"
machine = { path = "../machine" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ machine = { path = "../machine" }
macros = { path = "../../util/macros" }
parity-bytes = "0.1"
parking_lot = "0.8"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
rand = "0.6"
rlp = "0.4.0"
trace-time = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion ethcore/trace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ evm = { path = "../evm" }
kvdb = "0.1.0"
log = "0.4"
parity-bytes = "0.1.0"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
parking_lot = "0.8.0"
rlp = "0.4.0"
rlp_derive = { path = "../../util/rlp-derive" }
Expand Down
2 changes: 1 addition & 1 deletion ethcore/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ethjson = { path = "../../json" }
ethkey = { path = "../../accounts/ethkey" }
keccak-hash = "0.2.0"
parity-bytes = "0.1"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
parity-snappy = "0.1"
patricia-trie-ethereum = { path = "../../util/patricia-trie-ethereum" }
rlp = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ethabi-contract = "8.0"
ethcore-call-contract = { path = "../ethcore/call-contract" }
ethereum-types = "0.6.0"
futures = "0.1"
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
keccak-hash = "0.2.0"
linked-hash-map = "0.5"
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion util/journaldb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2018"
parity-bytes = "0.1"
ethereum-types = "0.6.0"
hash-db = "0.15.0"
malloc_size_of = { version = "0.1", package = "parity-util-mem" }
malloc_size_of = { version = "0.2", package = "parity-util-mem" }
keccak-hasher = { path = "../keccak-hasher" }
kvdb = "0.1"
log = "0.4"
Expand Down
4 changes: 1 addition & 3 deletions util/journaldb/src/archivedb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ impl JournalDB for ArchiveDB {
}

fn mem_used(&self) -> usize {
// TODO EMCH restore when update of parity-util-mem
//self.overlay.malloc_size_of()
0
self.overlay.malloc_size_of()
}

fn is_empty(&self) -> bool {
Expand Down
7 changes: 2 additions & 5 deletions util/journaldb/src/earlymergedb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,11 @@ impl JournalDB for EarlyMergeDB {

fn mem_used(&self) -> usize {
let mut ops = new_malloc_size_ops();
// TODO EMCH restore when update of parity-util-mem
//self.overlay.size_of(&mut ops) +
0 +
match self.refs {
self.overlay.size_of(&mut ops) + match self.refs {
Some(ref c) => c.read().size_of(&mut ops),
None => 0
}
}
}

fn state(&self, id: &H256) -> Option<Bytes> {
self.backing.get_by_prefix(self.column, &id[0..DB_PREFIX_LEN]).map(|b| b.into_vec())
Expand Down
16 changes: 7 additions & 9 deletions util/journaldb/src/overlayrecentdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,15 @@ impl JournalDB for OverlayRecentDB {
}

fn mem_used(&self) -> usize {
// TODO EMCH restore when update utilmem
// let mut ops = new_malloc_size_ops();
//let mut mem = self.transaction_overlay.size_of(&mut ops);
// let overlay = self.journal_overlay.read();
let mut ops = new_malloc_size_ops();
let mut mem = self.transaction_overlay.size_of(&mut ops);
let overlay = self.journal_overlay.read();

// mem += overlay.backing_overlay.size_of(&mut ops);
// mem += overlay.pending_overlay.size_of(&mut ops);
// mem += overlay.journal.size_of(&mut ops);
mem += overlay.backing_overlay.size_of(&mut ops);
mem += overlay.pending_overlay.size_of(&mut ops);
mem += overlay.journal.size_of(&mut ops);

// mem
0
mem
}

fn journal_size(&self) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion util/memory-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = "An LRU-cache which operates on memory used"
license = "GPL3"

[dependencies]
parity-util-mem = "0.1"
parity-util-mem = "0.2.0"
lru-cache = "0.1"