parity-common icon indicating copy to clipboard operation
parity-common copied to clipboard

[parity-util-mem] add an attribute to call a function to calculate heap usage

Open dvdplm opened this issue 4 years ago • 0 comments

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]?

dvdplm avatar Oct 31 '19 09:10 dvdplm