From e4ac2d4acc8cb44df2107e3fa1067755feaaa005 Mon Sep 17 00:00:00 2001 From: Rick Hudson Date: Tue, 16 Feb 2016 17:16:43 -0500 Subject: [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 --- src/runtime/malloc.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/runtime/malloc.go') 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 } -- cgit v1.3