Merge pull request #200 from zcash/memuse-0.2

memuse 0.2
This commit is contained in:
Kris Nuttycombe 2021-09-14 16:14:18 -06:00 committed by GitHub
commit 78e22f6325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -29,7 +29,7 @@ fpe = "0.5"
group = "0.11" group = "0.11"
halo2 = "0.0" halo2 = "0.0"
lazy_static = "1" lazy_static = "1"
memuse = { version = "0.1", features = ["nonempty"] } memuse = { version = "0.2", features = ["nonempty"] }
pasta_curves = "0.2" pasta_curves = "0.2"
proptest = { version = "1.0.0", optional = true } proptest = { version = "1.0.0", optional = true }
rand = "0.8" rand = "0.8"

View File

@ -5,7 +5,7 @@ pub mod commitments;
use std::io; use std::io;
use blake2b_simd::Hash as Blake2bHash; use blake2b_simd::Hash as Blake2bHash;
use memuse::{DynamicUsage, NoDynamicUsage}; use memuse::DynamicUsage;
use nonempty::NonEmpty; use nonempty::NonEmpty;
use zcash_note_encryption::try_note_decryption; use zcash_note_encryption::try_note_decryption;
@ -134,7 +134,17 @@ impl<T> Action<T> {
} }
} }
impl NoDynamicUsage for Action<redpallas::Signature<SpendAuth>> {} impl DynamicUsage for Action<redpallas::Signature<SpendAuth>> {
#[inline(always)]
fn dynamic_usage(&self) -> usize {
0
}
#[inline(always)]
fn dynamic_usage_bounds(&self) -> (usize, Option<usize>) {
(0, Some(0))
}
}
/// Orchard-specific flags. /// Orchard-specific flags.
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]