From ee4b61a32e9cbc8ef5ce484dbf1e5133459b8771 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 10 Jan 2024 22:59:37 -0800 Subject: [PATCH] runtime: don't mark unrolled bitmap type as having a gc program It doesn't have a GC program - the whole point is that it is the unrolled version of a GC program. Fortunately, this isn't a bug as (*mspan).typePointersOfUnchecked ignores the GCProg flag and just uses GCData as a bitmap unconditionally. Change-Id: I2508af85af4a1806946e54c893120c5cc0cc3da3 Reviewed-on: https://go-review.googlesource.com/c/go/+/555355 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek Reviewed-by: Keith Randall --- src/runtime/mbitmap_allocheaders.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/runtime/mbitmap_allocheaders.go b/src/runtime/mbitmap_allocheaders.go index 2151c12b858..bc574ad6894 100644 --- a/src/runtime/mbitmap_allocheaders.go +++ b/src/runtime/mbitmap_allocheaders.go @@ -883,12 +883,11 @@ func heapSetType(x, dataSize uintptr, typ *_type, header **_type, span *mspan) ( // We only need to write size, PtrBytes, and GCData, since that's all // the GC cares about. gctyp = (*_type)(unsafe.Pointer(progSpan.base())) - gctyp.Kind_ |= kindGCProg gctyp.Size_ = typ.Size_ gctyp.PtrBytes = typ.PtrBytes gctyp.GCData = (*byte)(add(unsafe.Pointer(progSpan.base()), heapBitsOff)) - // Expand the GC program into space reserved at the end of the object. + // Expand the GC program into space reserved at the end of the new span. runGCProg(addb(typ.GCData, 4), gctyp.GCData) }