-
Notifications
You must be signed in to change notification settings - Fork 50
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
Expose dealloc function that doesn't require Layout
?
#103
Comments
Why not use |
Note that dealloc is provided by the GlobalAlloc trait, it's interface is outside of this crate's control. Also note that even if you know mimalloc is the |
Interesting, do you have more info on that? The docs seem to suggest
I think what is being asked for is a separate function on the MiMalloc struct that can free without a layout. Not sure how good of an idea it is to promote freeing without a layout though. |
Thanks for making this!
I notice the
dealloc
function takes an unused_layout
parameter (in order to satisfy the allocator trait, which makes sense) - but I have a use case where I'd like to call a version of that function that doesn't require being passed a layout at all (because I'll be calling it directly and won't have access to the layout when I'm calling it).I could always call the current
dealloc
passing an empty layout, since I know that it's currently unused, but it would be risky for me to rely on that assumption; it seems pretty likely that I could get some really bad behavior if that argument somehow stopped being unused in a future release of the crate, and I wouldn't even get a compiler error!If this is a design you're open to, I'd be happy to contribute a PR for it!
The text was updated successfully, but these errors were encountered: