aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2024-01-10 22:59:37 -0800
committerKeith Randall <khr@golang.org>2024-01-11 16:19:41 +0000
commitee4b61a32e9cbc8ef5ce484dbf1e5133459b8771 (patch)
tree801a3a650dae357a0d4434f61f2207f24e5b44c7
parente9b3ff15f40d6b258217b3467c662f816b078477 (diff)
downloadgo-ee4b61a32e9cbc8ef5ce484dbf1e5133459b8771.tar.gz
go-ee4b61a32e9cbc8ef5ce484dbf1e5133459b8771.zip
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@google.com>
-rw-r--r--src/runtime/mbitmap_allocheaders.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/runtime/mbitmap_allocheaders.go b/src/runtime/mbitmap_allocheaders.go
index 2151c12b85..bc574ad689 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)
}