You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 viaBox::from_raw
, so it can be deallocated. This is something a simple bump allocator would not meaningfully facilitate.The text was updated successfully, but these errors were encountered: