wingo pushed a commit to branch wip-whippet
in repository guile.

commit 59b85abbda4d9004e231b429c45e64914bd3f9fd
Author: Andy Wingo <wi...@igalia.com>
AuthorDate: Sun Aug 25 20:46:05 2024 +0200

    Fix regarding memset of block marks
---
 src/nofl-space.h | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/nofl-space.h b/src/nofl-space.h
index 2a657f7d7..989fc562d 100644
--- a/src/nofl-space.h
+++ b/src/nofl-space.h
@@ -258,19 +258,6 @@ nofl_block_set_mark(uintptr_t addr) {
                            memory_order_relaxed);
 }
 
-static void
-nofl_block_clear_mark(uintptr_t addr) {
-  uintptr_t base = align_down(addr, NOFL_SLAB_SIZE);
-  struct nofl_slab *slab = (struct nofl_slab *) base;
-  unsigned block_idx = (addr / NOFL_BLOCK_SIZE) % NOFL_BLOCKS_PER_SLAB;
-  uint8_t mark_byte = block_idx / 8;
-  GC_ASSERT(mark_byte < NOFL_HEADER_BYTES_PER_SLAB);
-  uint8_t mark_mask = 1U << (block_idx % 8);
-  atomic_fetch_and_explicit(&slab->header.block_marks[mark_byte],
-                            ~mark_mask,
-                            memory_order_relaxed);
-}
-
 #define NOFL_GRANULES_PER_BLOCK (NOFL_BLOCK_SIZE / NOFL_GRANULE_SIZE)
 #define NOFL_GRANULES_PER_REMSET_BYTE \
   (NOFL_GRANULES_PER_BLOCK / NOFL_REMSET_BYTES_PER_BLOCK)
@@ -934,7 +921,7 @@ static void
 nofl_space_clear_block_marks(struct nofl_space *space) {
   for (size_t s = 0; s < space->nslabs; s++) {
     struct nofl_slab *slab = &space->slabs[s];
-    memset(&slab->header.block_marks, 0, NOFL_BLOCKS_PER_SLAB / 8);
+    memset(slab->header.block_marks, 0, NOFL_BLOCKS_PER_SLAB / 8);
   }
 }
 

Reply via email to