-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add a method to the arena to promote objects to it if they implement LocalDrop #56448
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Blocked on #56447. |
|
||
/// A type which does not look at references in its destructor | ||
/// but only owned data | ||
pub unsafe trait LocalDrop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@Zoxc, can you give some explanation and reasoning of the concepts any changes here? What is |
Promotion would be allocating types with destructors on the dropless arena by deferring execution of their destructors to when the arena is dropped. We can only allow that for types which do not access other promoted objects during destruction, since those promoted object may have been destroyed earlier. Such allowed types implement |
The point of the dropless arena is that, well, it has no destructors, simplifying a few things. You can add separate regular typed arenas for things you can't make dropless. |
☔ The latest upstream changes (presumably #56502) made this pull request unmergeable. Please resolve the merge conflicts. |
To be honest, that sounds a bit too magical for my taste. cc @rust-lang/compiler |
@eddyb wrote:
I want to clarify the point eddyb is making here. @eddyb, are you asking for @Zoxc to revise this PR to get rid of Or is your point just to explain what the purpose of |
@pnkfelix The former, except it's not a |
Introduce an arena type which may be used to allocate a list of types with destructors You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena. Based on #59517 and #59533. Look at the last commit for the interesting changes. An alternative to #56448. cc @michaelwoerister @eddyb r? @oli-obk
Introduce an arena type which may be used to allocate a list of types with destructors You can also specify that you want deserializers for `&'tcx [T]` and `&'tcx T` for a type in the list, which will allocate those using the arena. Based on #59517 and #59533. Look at the last commit for the interesting changes. An alternative to #56448. cc @michaelwoerister @eddyb r? @oli-obk
A cleaned up part from #56382.
Uses PROC MACROS! cc @eddyb
r? @michaelwoerister