void MarkSweepGC::after_marked() { times_collected++; last_freed = 0; // Cleanup all weakrefs seen clean_weakrefs(); // Sweep up the garbage sweep_objects(); }
void MarkSweepGC::after_marked() { metrics::MetricsData* metrics = object_memory_->state()->metrics(); timer::StopWatch<timer::milliseconds> timer( metrics->m.ruby_metrics.gc_large_sweep_last_ms, metrics->m.ruby_metrics.gc_large_sweep_total_ms); last_freed = 0; // Cleanup all weakrefs seen clean_weakrefs(); // Sweep up the garbage sweep_objects(); }
void MarkSweepGC::collect(Roots &roots) { Object* tmp; Root* root = static_cast<Root*>(roots.head()); while(root) { tmp = root->get(); if(tmp->reference_p()) { saw_object(tmp); } root = static_cast<Root*>(root->next()); } // Cleanup all weakrefs seen clean_weakrefs(); // Sweep up the garbage sweep_objects(); }