macro_rules! impl_heap_size{
( zero gen_test $($typ: ty,)+ ) => {
impl_heap_size!{
zero $($typ,)+
}
#[test]
fn test() {
use $crate::HeapSize;
$({
let v = <$typ as Default>::default();
assert_eq!(0, v.heap_size());
})+
}
};
( zero $($typ: ty,)+ ) => {
$(
impl $crate::HeapSize for $typ {
fn heap_size(&self) -> usize { 0 }
}
)+
};
( container $self_: tt, $( $(#[$attr:meta])* $typ: ty => $heap_size_block: block,)+ ) => {
$(
impl<T: $crate::HeapSize> $crate::HeapSize for $typ {
$(#[$attr])*
fn heap_size(&$self_) -> usize {
let inner = $heap_size_block;
T::heap_size(inner)
}
}
)+
}
}
mod cores;
mod allocs;
mod stds;
#[cfg(feature = "bytes")]
mod bytes;
#[cfg(feature = "protobuf2")]
mod protobuf2;