[parity-util-mem] add an attribute to call a function to calculate heap usage #255
Labels
F8-enhancement
hacktoberfest
Join us for hacktoberfest - https://substrate.dev/hacktoberfest/
M4-core
P9-somedaymaybe
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]
?The text was updated successfully, but these errors were encountered: