aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mcache.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-11-16 15:31:50 -0500
committerAustin Clements <austin@google.com>2015-11-16 22:07:41 +0000
commit4d39bb6a3a06a7690242559113b7434591e97cbf (patch)
tree51c87a9cf540272999d52a22bb1c30d8a437ef28 /src/runtime/mcache.go
parent835c83b40dd9b94b51180898551b313a92892ffd (diff)
downloadgo-4d39bb6a3a06a7690242559113b7434591e97cbf.tar.gz
go-4d39bb6a3a06a7690242559113b7434591e97cbf.zip
runtime: make mcache.tiny a uintptr
mcache.tiny is in non-GC'd memory, but points to heap memory. As a result, there may or may not be write barriers when writing to mcache.tiny. Make it clearer that funny things are going on by making mcache.tiny a uintptr instead of an unsafe.Pointer. Change-Id: I732a5b7ea17162f196a9155154bbaff8d4d00eac Reviewed-on: https://go-review.googlesource.com/16963 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/mcache.go')
-rw-r--r--src/runtime/mcache.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/mcache.go b/src/runtime/mcache.go
index c80c5b095a..c843fb2096 100644
--- a/src/runtime/mcache.go
+++ b/src/runtime/mcache.go
@@ -27,7 +27,7 @@ type mcache struct {
// tiny is a heap pointer. Since mcache is in non-GC'd memory,
// we handle it by clearing it in releaseAll during mark
// termination.
- tiny unsafe.Pointer
+ tiny uintptr
tinyoffset uintptr
local_tinyallocs uintptr // number of tiny allocs not counted in other stats
@@ -139,6 +139,6 @@ func (c *mcache) releaseAll() {
}
}
// Clear tinyalloc pool.
- c.tiny = nil
+ c.tiny = 0
c.tinyoffset = 0
}