Skip to content

Conversation

LucaCappelletti94
Copy link

Mem-dbg is a crate that allows to compute the size of a struct. I have added the derives through the crate as an optional feature, so as to use it to compare this implementation with others easily.

Cheers!

@LucaCappelletti94
Copy link
Author

@tabac I have fixed a rather important error in the library in commit a137c97 - the estimates array were NOT sorted, but a binary search was used nevertheless. I have now sorted estimates alongside their biases so that the binary search actually makes sense.

@tabac
Copy link
Owner

tabac commented Aug 13, 2024

@LucaCappelletti94 thanks a lot for the PR. I will look into it as soon as possible (probably ~end-of-month).

@tabac
Copy link
Owner

tabac commented Aug 26, 2024

@LucaCappelletti94 PR LGTM.

Three questions I have:

  • I would like to keep the requirements of the library to the minimum. Would it be possible to compute the struct sizes using mem-dbg in another crate by just wrapping the original structs?

  • Would you mind reverting the constants.rs reformatting, it is hard to see the diff this way. Also, since you change the order of the estimates you should change the corresponding biases too.

  • Finally, could you add a comment here that the data are not copied verbatim but instead sorted.

Thanks again for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants