Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dvdplm opened this issue Oct 31, 2019 · 0 comments
Closed
Labels
F8-enhancement hacktoberfest Join us for hacktoberfest - https://substrate.dev/hacktoberfest/ M4-core P9-somedaymaybe

Comments

@dvdplm
Copy link
Contributor

dvdplm commented Oct 31, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F8-enhancement hacktoberfest Join us for hacktoberfest - https://substrate.dev/hacktoberfest/ M4-core P9-somedaymaybe
Projects
None yet
Development

No branches or pull requests

2 participants