1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-10 15:50:50 +02:00

Refactor post-collection for mark space

This commit is contained in:
Andy Wingo 2022-07-20 10:43:17 +02:00
parent 69caead182
commit 8409383ee1

View file

@ -849,6 +849,12 @@ static void determine_collection_kind(struct heap *heap,
} }
} }
static void mark_space_finish_gc(struct mark_space *space) {
reset_sweeper(space);
rotate_mark_bytes(space);
reset_statistics(space);
}
static void collect(struct mutator *mut, enum gc_reason reason) { static void collect(struct mutator *mut, enum gc_reason reason) {
struct heap *heap = mutator_heap(mut); struct heap *heap = mutator_heap(mut);
struct mark_space *space = heap_mark_space(heap); struct mark_space *space = heap_mark_space(heap);
@ -872,11 +878,9 @@ static void collect(struct mutator *mut, enum gc_reason reason) {
trace_global_roots(heap); trace_global_roots(heap);
tracer_trace(heap); tracer_trace(heap);
tracer_release(heap); tracer_release(heap);
reset_sweeper(space); mark_space_finish_gc(space);
rotate_mark_bytes(space);
heap->count++;
reset_statistics(space);
large_object_space_finish_gc(lospace); large_object_space_finish_gc(lospace);
heap->count++;
heap_reset_large_object_pages(heap, lospace->live_pages_at_last_collection); heap_reset_large_object_pages(heap, lospace->live_pages_at_last_collection);
allow_mutators_to_continue(heap); allow_mutators_to_continue(heap);
DEBUG("collect done\n"); DEBUG("collect done\n");