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

Consider being even more ridiculously leaky #20

Open
workingjubilee opened this issue Mar 19, 2024 · 0 comments
Open

Consider being even more ridiculously leaky #20

workingjubilee opened this issue Mar 19, 2024 · 0 comments

Comments

@workingjubilee
Copy link

workingjubilee commented Mar 19, 2024

Currently, you use bumpalo, which is a reasonable choice, but you can achieve much the same end result via Box::leak.

At the moment, there's no particular reason to do this aside from eliminating the dependency, and I did it by hand when reducing the binom.v extraction into a compiletest for rustc.

However, if you arrived at a point where you had a proof that this was the last remaining reference, you could coerce the reference to a pointer, then cast_mut and upgrade it to the original Box via Box::from_raw, so it can be deallocated. This is something a simple bump allocator would not meaningfully facilitate.

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

No branches or pull requests

1 participant