fixed-hash implements heap-size, version 0.1.1
This commit is contained in:
parent
0e4818d133
commit
f625fc12ed
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "fixed-hash"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
authors = ["debris <marek.kotewicz@gmail.com>"]
|
||||
license = "MIT"
|
||||
homepage = "https://github.com/paritytech/primitives"
|
||||
|
|
|
@ -306,9 +306,30 @@ macro_rules! construct_hash {
|
|||
}
|
||||
|
||||
impl_std_for_hash!($from, $size);
|
||||
impl_heapsize_for_hash!($from);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature="heapsizeof")]
|
||||
#[macro_export]
|
||||
#[doc(hidden)]
|
||||
macro_rules! impl_heapsize_for_hash {
|
||||
($name: ident) => {
|
||||
impl $crate::heapsize::HeapSizeOf for $name {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature="heapsizeof"))]
|
||||
#[macro_export]
|
||||
#[doc(hidden)]
|
||||
macro_rules! impl_heapsize_for_hash {
|
||||
($name: ident) => {}
|
||||
}
|
||||
|
||||
#[cfg(feature="std")]
|
||||
#[macro_export]
|
||||
#[doc(hidden)]
|
||||
|
|
Loading…
Reference in New Issue