mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
835c83b40d
commit
4d39bb6a3a
2 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue