1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-19 19:20:23 +02:00

Update extern space API to allow for evacuation

This commit is contained in:
Andy Wingo 2023-08-16 11:08:12 +02:00
parent fbe49598f5
commit db36c48efd
4 changed files with 13 additions and 10 deletions

View file

@ -199,12 +199,13 @@ static int semi_space_contains(struct semi_space *space, struct gc_ref ref) {
static void visit_external_object(struct gc_heap *heap,
struct gc_extern_space *space,
struct gc_ref ref) {
if (gc_extern_space_mark(space, ref)) {
struct gc_edge edge,
struct gc_ref old_ref) {
if (gc_extern_space_visit(space, edge, old_ref)) {
if (GC_UNLIKELY(heap->check_pending_ephemerons))
gc_resolve_pending_ephemerons(ref, heap);
gc_resolve_pending_ephemerons(old_ref, heap);
gc_trace_object(ref, trace, heap, NULL, NULL);
gc_trace_object(gc_edge_ref(edge), trace, heap, NULL, NULL);
}
}
@ -217,7 +218,7 @@ static void visit(struct gc_edge edge, struct gc_heap *heap) {
else if (large_object_space_contains(heap_large_object_space(heap), ref))
visit_large_object_space(heap, heap_large_object_space(heap), ref);
else
visit_external_object(heap, heap->extern_space, ref);
visit_external_object(heap, heap->extern_space, edge, ref);
}
struct gc_pending_ephemerons *