Skip to content
Open
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
7 changes: 6 additions & 1 deletion mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ pub extern "C" fn mmtk_gc_init(
let success = builder.options.threads.set(n_gcthreads);
assert!(success, "Failed to set GC threads to {}", n_gcthreads);
}

if cfg!(feature = "print_fragmentation") {
let success = builder.options.count_live_bytes_in_gc.set(true);
assert!(success, "Failed to enable live byte counting in GC");
}
}

// Make sure that we haven't initialized MMTk (by accident) yet
Expand Down Expand Up @@ -643,7 +648,7 @@ pub extern "C" fn get_mmtk_version() -> *const c_char {
pub extern "C" fn print_fragmentation() {
let map = memory_manager::live_bytes_in_last_gc(&SINGLETON);
for (space, stats) in map {
println!(
eprintln!(
"Utilization in space {:?}: {} live bytes, {} total bytes, {:.2} %",
space,
stats.live_bytes,
Expand Down