diff options
author | Austin Clements <austin@google.com> | 2017-10-25 13:46:54 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2017-10-29 20:22:00 +0000 |
commit | 164e1b84777082d83d659a16fad8e1d0456a8638 (patch) | |
tree | 00d912b849a877e87ae3e403572353553e862c93 /src/runtime/slice.go | |
parent | b78b54ff83bab4587f0df5747f432d1b3e7e6846 (diff) | |
download | go-164e1b84777082d83d659a16fad8e1d0456a8638.tar.gz go-164e1b84777082d83d659a16fad8e1d0456a8638.zip |
runtime: eliminate remaining recordspan write barriers
recordspan has two remaining write barriers from writing to the
pointer to the backing store of h.allspans. However, h.allspans is
always backed by off-heap memory, so let the compiler know this.
Unfortunately, this isn't quite as clean as most go:notinheap uses
because we can't directly name the backing store of a slice, but we
can get it done with some judicious casting.
For #22460.
Change-Id: I296f92fa41cf2cb6ae572b35749af23967533877
Reviewed-on: https://go-review.googlesource.com/73414
Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/slice.go')
-rw-r--r-- | src/runtime/slice.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/slice.go b/src/runtime/slice.go index 937d15a51b..f79aa02c3b 100644 --- a/src/runtime/slice.go +++ b/src/runtime/slice.go @@ -14,6 +14,13 @@ type slice struct { cap int } +// An notInHeapSlice is a slice backed by go:notinheap memory. +type notInHeapSlice struct { + array *notInHeap + len int + cap int +} + // maxElems is a lookup table containing the maximum capacity for a slice. // The index is the size of the slice element. var maxElems = [...]uintptr{ |