parity-common
parity-common copied to clipboard
[parity-util-mem] add an attribute to call a function to calculate heap usage
Right now there it is not easy to use the MallocSizeOf
derive macro on structs that have members that do not implement the trait, especially if those members have types from third party crates.
One way around it could be to add a new attribute pointing to a function to be used to calculate the size, sort of like Serde's #[serialize_with = my_func]
attribute, maybe #[calculate_malloc_size_of_with = myfunc]
?