aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/trace.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-10-11 22:58:21 -0400
committerAustin Clements <austin@google.com>2016-10-15 17:58:20 +0000
commit1bc6be6423e48318451a0faeaae840772137b001 (patch)
tree013de581e0dd5d1a65aac79b665b41afd5cb3586 /src/runtime/trace.go
parent991a85c88944e9cb92c4860c173f49d549a92845 (diff)
downloadgo-1bc6be6423e48318451a0faeaae840772137b001.tar.gz
go-1bc6be6423e48318451a0faeaae840772137b001.zip
runtime: mark several types go:notinheap
This covers basically all sysAlloc'd, persistentalloc'd, and fixalloc'd types. Change-Id: I0487c887c2a0ade5e33d4c4c12d837e97468e66b Reviewed-on: https://go-review.googlesource.com/30941 Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src/runtime/trace.go')
-rw-r--r--src/runtime/trace.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/trace.go b/src/runtime/trace.go
index b64debcac4..4c0f1de44b 100644
--- a/src/runtime/trace.go
+++ b/src/runtime/trace.go
@@ -134,6 +134,8 @@ type traceBufHeader struct {
}
// traceBuf is per-P tracing buffer.
+//
+//go:notinheap
type traceBuf struct {
traceBufHeader
arr [64<<10 - unsafe.Sizeof(traceBufHeader{})]byte // underlying buffer for traceBufHeader.buf
@@ -144,6 +146,8 @@ type traceBuf struct {
// allocated from the GC'd heap, so this is safe, and are often
// manipulated in contexts where write barriers are not allowed, so
// this is necessary.
+//
+// TODO: Since traceBuf is now go:notinheap, this isn't necessary.
type traceBufPtr uintptr
func (tp traceBufPtr) ptr() *traceBuf { return (*traceBuf)(unsafe.Pointer(tp)) }
@@ -828,11 +832,14 @@ type traceAlloc struct {
// traceAllocBlock is allocated from non-GC'd memory, so it must not
// contain heap pointers. Writes to pointers to traceAllocBlocks do
// not need write barriers.
+//
+//go:notinheap
type traceAllocBlock struct {
next traceAllocBlockPtr
data [64<<10 - sys.PtrSize]byte
}
+// TODO: Since traceAllocBlock is now go:notinheap, this isn't necessary.
type traceAllocBlockPtr uintptr
func (p traceAllocBlockPtr) ptr() *traceAllocBlock { return (*traceAllocBlock)(unsafe.Pointer(p)) }