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/stack.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/runtime/stack.go') diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 8fd7ef2bcf..1ca737e920 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -191,8 +191,8 @@ func stackpoolalloc(order uint8) gclinkptr { if s == nil { throw("out of memory") } - if s.ref != 0 { - throw("bad ref") + if s.allocCount != 0 { + throw("bad allocCount") } if s.stackfreelist.ptr() != nil { throw("bad stackfreelist") @@ -209,7 +209,7 @@ func stackpoolalloc(order uint8) gclinkptr { throw("span has no free stacks") } s.stackfreelist = x.ptr().next - s.ref++ + s.allocCount++ if s.stackfreelist.ptr() == nil { // all stacks in s are allocated. list.remove(s) @@ -229,8 +229,8 @@ func stackpoolfree(x gclinkptr, order uint8) { } x.ptr().next = s.stackfreelist s.stackfreelist = x - s.ref-- - if gcphase == _GCoff && s.ref == 0 { + s.allocCount-- + if gcphase == _GCoff && s.allocCount == 0 { // Span is completely free. Return it to the heap // immediately if we're sweeping. // @@ -1135,7 +1135,7 @@ func freeStackSpans() { list := &stackpool[order] for s := list.first; s != nil; { next := s.next - if s.ref == 0 { + if s.allocCount == 0 { list.remove(s) s.stackfreelist = 0 mheap_.freeStack(s) -- cgit v1.3