diff options
author | Keith Randall <khr@golang.org> | 2020-08-21 20:20:12 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2020-08-25 01:46:05 +0000 |
commit | d9a6bdf7ef4d0dd15608427b0f7ba3c45c221a3c (patch) | |
tree | b2d75e4e50e5204d89380233ca4b20a4c8ef6c8a /src/runtime/mgcstack.go | |
parent | 95df156e6ac53f98efd6c57e4586c1dfb43066dd (diff) | |
download | go-d9a6bdf7ef4d0dd15608427b0f7ba3c45c221a3c.tar.gz go-d9a6bdf7ef4d0dd15608427b0f7ba3c45c221a3c.zip |
cmd/compile: don't allow go:notinheap on the heap or stack
Right now we just prevent such types from being on the heap. This CL
makes it so they cannot appear on the stack either. The distinction
between heap and stack is pretty vague at the language level (e.g. it
is affected by -N), and we don't need the flexibility anyway.
Once go:notinheap types cannot be in either place, we don't need to
consider pointers to such types to be pointers, at least according to
the garbage collector and stack copying. (This is the big win of this
CL, in my opinion.)
The distinction between HasPointers and HasHeapPointer no longer
exists. There is only HasPointers.
This CL is cleanup before possible use of go:notinheap to fix #40954.
Update #13386
Change-Id: Ibd895aadf001c0385078a6d4809c3f374991231a
Reviewed-on: https://go-review.googlesource.com/c/go/+/249917
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/runtime/mgcstack.go')
-rw-r--r-- | src/runtime/mgcstack.go | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/runtime/mgcstack.go b/src/runtime/mgcstack.go index 211d882fa6..8eb941a328 100644 --- a/src/runtime/mgcstack.go +++ b/src/runtime/mgcstack.go @@ -167,8 +167,6 @@ func (obj *stackObject) setType(typ *_type) { // A stackScanState keeps track of the state used during the GC walk // of a goroutine. -// -//go:notinheap type stackScanState struct { cache pcvalueCache |