From b37a7f3862f6bc04c860ae18b4a0fdc653915ce1 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 13 Jan 2025 09:12:34 +0100 Subject: [PATCH] copy-space: Fix bug computing field logging byte location Also re-enable survivors in generational-pcc :) --- src/copy-space.h | 2 +- src/pcc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/copy-space.h b/src/copy-space.h index 0fbf4b111..e95ec0322 100644 --- a/src/copy-space.h +++ b/src/copy-space.h @@ -346,7 +346,7 @@ copy_space_field_logged_byte(struct gc_edge edge) { base += offsetof(struct copy_space_slab, blocks); uintptr_t field = (addr & (COPY_SPACE_SLAB_SIZE - 1)) / sizeof(uintptr_t); uintptr_t byte = field / 8; - return (uint8_t*) (base + field); + return (uint8_t*) (base + byte); } static uint8_t diff --git a/src/pcc.c b/src/pcc.c index 4b4a99700..ff10375ef 100644 --- a/src/pcc.c +++ b/src/pcc.c @@ -324,7 +324,7 @@ static inline int do_minor_trace(struct gc_heap *heap, struct gc_edge edge, // However however, it is hard to distinguish between edges from promoted // objects and edges from old objects, so we mostly just rely on an // idempotent "log if unlogged" operation instead. - int promote = copy_space_should_promote(new_space, ref) || 1; + int promote = copy_space_should_promote(new_space, ref); struct copy_space *dst_space = promote ? old_space : new_space; struct copy_space_allocator *alloc = promote ? trace_worker_old_space_allocator(data)