mirror of
https://github.com/golang/go.git
synced 2025-11-01 09:10:57 +00:00
[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>
This commit is contained in:
parent
3479b065d4
commit
e4ac2d4acc
6 changed files with 31 additions and 31 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue