-
Notifications
You must be signed in to change notification settings - Fork 78
Allow querying if the current GC may move objects. #1128
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
Changes from 4 commits
a4401ce
e27e488
4f3b815
9a8d74e
e8e2766
ccd8e61
affd84f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -126,9 +126,6 @@ impl<VM: VMBinding> Plan for StickyImmix<VM> { | |||||
|
||||||
fn release(&mut self, tls: crate::util::VMWorkerThread) { | ||||||
if self.is_current_gc_nursery() { | ||||||
let was_defrag = self.immix.immix_space.release(false); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still need to call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. New objects can be allocated into the |
||||||
self.immix | ||||||
.set_last_gc_was_defrag(was_defrag, Ordering::Relaxed); | ||||||
self.immix.common.los.release(false); | ||||||
} else { | ||||||
self.immix.release(tls); | ||||||
|
@@ -140,6 +137,10 @@ impl<VM: VMBinding> Plan for StickyImmix<VM> { | |||||
crate::plan::generational::global::CommonGenPlan::should_next_gc_be_full_heap(self); | ||||||
self.next_gc_full_heap | ||||||
.store(next_gc_full_heap, Ordering::Relaxed); | ||||||
|
||||||
let was_defrag = self.immix.immix_space.end_of_gc(); | ||||||
self.immix | ||||||
.set_last_gc_was_defrag(was_defrag, Ordering::Relaxed); | ||||||
} | ||||||
|
||||||
fn collection_required(&self, space_full: bool, space: Option<SpaceStats<Self::VM>>) -> bool { | ||||||
|
@@ -158,6 +159,14 @@ impl<VM: VMBinding> Plan for StickyImmix<VM> { | |||||
self.gc_full_heap.load(Ordering::Relaxed) && self.immix.last_collection_was_exhaustive() | ||||||
} | ||||||
|
||||||
fn current_gc_may_move_object(&self) -> bool { | ||||||
if self.is_current_gc_nursery() { | ||||||
!cfg!(feature = "sticky_immix_non_moving_nursery") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be easier to understand and less error prone than directly checking the feature.
Suggested change
|
||||||
} else { | ||||||
return self.get_immix_space().in_defrag(); | ||||||
} | ||||||
} | ||||||
|
||||||
fn get_collection_reserved_pages(&self) -> usize { | ||||||
self.immix.get_collection_reserved_pages() | ||||||
} | ||||||
|
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.
Mentioning defrag could be confusing here.