From 9bcca974ba7c9209ac7df97e39a126da9610e027 Mon Sep 17 00:00:00 2001 From: Nia Waldvogel Date: Sun, 28 Dec 2025 12:46:29 -0500 Subject: [PATCH] internal/gclayout: use correct lengths The GC bitmap length is measured in multiples of the pointer alignment. This is equal to the pointer size on all architectures except AVR. Replace the hardcoded lengths with lengths that are computed naturally. --- src/internal/gclayout/gclayout.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/internal/gclayout/gclayout.go b/src/internal/gclayout/gclayout.go index 76a03adc6..d6235889f 100644 --- a/src/internal/gclayout/gclayout.go +++ b/src/internal/gclayout/gclayout.go @@ -13,12 +13,14 @@ const ( // 64-bit int => bits = 6 sizeBits = 4 + unsafe.Sizeof(uintptr(0))/4 + ptrAlign = unsafe.Alignof(uintptr(0)) + sizeShift = sizeBits + 1 - NoPtrs = Layout(uintptr(0b0<