]> Cypherpunks.ru repositories - gostls13.git/commitdiff
runtime: don't mark unrolled bitmap type as having a gc program
authorKeith Randall <khr@golang.org>
Thu, 11 Jan 2024 06:59:37 +0000 (22:59 -0800)
committerKeith Randall <khr@golang.org>
Thu, 11 Jan 2024 16:19:41 +0000 (16:19 +0000)
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>
src/runtime/mbitmap_allocheaders.go

index 2151c12b858ed2777bffa29d1edac05cce07ebb6..bc574ad68943efe1fb9799dedae12ce6e75e40bf 100644 (file)
@@ -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)
                }