diff options
| author | Rick Hudson <rlh@golang.org> | 2016-02-16 17:16:43 -0500 |
|---|---|---|
| committer | Rick Hudson <rlh@golang.org> | 2016-04-27 21:54:49 +0000 |
| commit | e4ac2d4acc8cb44df2107e3fa1067755feaaa005 (patch) | |
| tree | 7c21e754aa738aa5cc297bdf98b7828498ddb0d3 /src/runtime/malloc.go | |
| parent | 3479b065d43f2990ac12e7b00ddff6f63a876ca9 (diff) | |
| download | go-e4ac2d4acc8cb44df2107e3fa1067755feaaa005.tar.xz | |
[dev.garbage] runtime: replace ref with allocCount
This is a renaming of the field ref to the
more appropriate allocCount. The field
holds the number of objects in the span
that are currently allocated. Some throws
strings were adjusted to more accurately
convey the meaning of allocCount.
Change-Id: I10daf44e3e9cc24a10912638c7de3c1984ef8efe
Reviewed-on: https://go-review.googlesource.com/19518
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/malloc.go')
| -rw-r--r-- | src/runtime/malloc.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index e635682cae..6db323a8d3 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -509,8 +509,8 @@ func (c *mcache) nextFree(sizeclass int8) (v gclinkptr, shouldhelpgc bool) { if freeIndex == s.nelems { // The span is full. - if uintptr(s.ref) != s.nelems { - throw("s.ref != s.nelems && freeIndex == s.nelems") + if uintptr(s.allocCount) != s.nelems { + throw("s.allocCount != s.nelems && freeIndex == s.nelems") } systemstack(func() { c.refill(int32(sizeclass)) @@ -526,9 +526,9 @@ func (c *mcache) nextFree(sizeclass int8) (v gclinkptr, shouldhelpgc bool) { v = gclinkptr(freeIndex*s.elemsize + s.base()) // Advance the freeIndex. s.freeindex = freeIndex + 1 - s.ref++ - if uintptr(s.ref) > s.nelems { - throw("s.ref > s.nelems") + s.allocCount++ + if uintptr(s.allocCount) > s.nelems { + throw("s.allocCount > s.nelems") } return } |
