Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/policy/marksweepspace/malloc_ms/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ impl<VM: VMBinding> MallocSpace<VM> {
}

pub fn new(args: crate::policy::space::PlanCreateSpaceArgs<VM>) -> Self {
if *args.options.count_live_bytes_in_gc {
// The implementation of counting live bytes needs a SpaceDescriptor which we do not have for MallocSpace.
// Besides we cannot meaningfully measure the live bytes vs total pages for MallocSpace.
panic!("count_live_bytes_in_gc is not supported by MallocSpace");
}
MallocSpace {
phantom: PhantomData,
active_bytes: AtomicUsize::new(0),
Expand Down
14 changes: 8 additions & 6 deletions src/scheduler/gc_work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ impl<C: GCWorkContext + 'static> GCWork<C::VM> for Release<C> {
debug_assert!(result.is_ok());
}

let live_bytes = mmtk
.scheduler
.worker_group
.get_and_clear_worker_live_bytes();
*mmtk.state.live_bytes_in_last_gc.borrow_mut() =
mmtk.aggregate_live_bytes_in_last_gc(live_bytes);
if *mmtk.get_options().count_live_bytes_in_gc {
let live_bytes = mmtk
.scheduler
.worker_group
.get_and_clear_worker_live_bytes();
*mmtk.state.live_bytes_in_last_gc.borrow_mut() =
mmtk.aggregate_live_bytes_in_last_gc(live_bytes);
}
}
}

Expand Down
Loading