mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 06:37:56 +00:00
Remove mem_info and references to parity-util-mem (#12795)
* Remove mem_info and some references to parity-util-mem * [Draft] Finish removing references to `parity-util-mem` * Upgrade dependencies * Update scripts/ci/deny.toml Co-authored-by: ordian <write@reusable.software> * Fix Cargo.lock (remove unwanted dependency changes) * Removed unused argument * Run cargo fmt (didn't have pre-commit set up) * Fix some CI errors * Fix another CI error * Remove unused dependency Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
@@ -36,7 +36,6 @@ pub(crate) const LAST_PRUNED: &[u8] = b"last_pruned";
|
||||
const PRUNING_JOURNAL: &[u8] = b"pruning_journal";
|
||||
|
||||
/// See module documentation.
|
||||
#[derive(parity_util_mem_derive::MallocSizeOf)]
|
||||
pub struct RefWindow<BlockHash: Hash, Key: Hash, D: MetaDb> {
|
||||
/// A queue of blocks keep tracking keys that should be deleted for each block in the
|
||||
/// pruning window.
|
||||
@@ -50,7 +49,6 @@ pub struct RefWindow<BlockHash: Hash, Key: Hash, D: MetaDb> {
|
||||
/// blocks in memory, and keep track of re-inserted keys to not delete them when pruning
|
||||
/// - `DbBacked`, used when the backend database supports reference counting, only keep
|
||||
/// a few number of blocks in memory and load more blocks on demand
|
||||
#[derive(parity_util_mem_derive::MallocSizeOf)]
|
||||
enum DeathRowQueue<BlockHash: Hash, Key: Hash, D: MetaDb> {
|
||||
Mem {
|
||||
/// A queue of keys that should be deleted for each block in the pruning window.
|
||||
@@ -60,7 +58,6 @@ enum DeathRowQueue<BlockHash: Hash, Key: Hash, D: MetaDb> {
|
||||
},
|
||||
DbBacked {
|
||||
// The backend database
|
||||
#[ignore_malloc_size_of = "Shared data"]
|
||||
db: D,
|
||||
/// A queue of keys that should be deleted for each block in the pruning window.
|
||||
/// Only caching the first few blocks of the pruning window, blocks inside are
|
||||
@@ -251,7 +248,7 @@ fn load_death_row_from_db<BlockHash: Hash, Key: Hash, D: MetaDb>(
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, parity_util_mem_derive::MallocSizeOf)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
struct DeathRow<BlockHash: Hash, Key: Hash> {
|
||||
hash: BlockHash,
|
||||
deleted: HashSet<Key>,
|
||||
@@ -345,10 +342,6 @@ impl<BlockHash: Hash, Key: Hash, D: MetaDb> RefWindow<BlockHash, Key, D> {
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
pub fn mem_used(&self) -> usize {
|
||||
0
|
||||
}
|
||||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.window_size() == 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user