fixed-hash implements heap-size, version 0.1.1

This commit is contained in:
debris 2018-01-02 15:40:16 +01:00
parent 0e4818d133
commit f625fc12ed
2 changed files with 22 additions and 1 deletions

View File

@ -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"

View File

@ -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)]