[dev.garbage] runtime: add stackfreelist

The freelist for normal objects and the freelist
for stacks share the same mspan field for holding
the list head but are operated on by different code
sequences. This overloading complicates the use of bit
vectors for allocation of normal objects. This change
refactors the use of the stackfreelist out from the
use of freelist.

Change-Id: I5b155b5b8a1fcd8e24c12ee1eb0800ad9b6b4fa0
Reviewed-on: https://go-review.googlesource.com/19315
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Rick Hudson 2016-02-08 09:53:14 -05:00
parent 2ac8bdc52a
commit aed861038f
2 changed files with 13 additions and 12 deletions

View file

@ -552,7 +552,7 @@ func (h *mheap) allocStack(npage uintptr) *mspan {
s := h.allocSpanLocked(npage)
if s != nil {
s.state = _MSpanStack
s.freelist = 0
s.stackfreelist = 0
s.ref = 0
memstats.stacks_inuse += uint64(s.npages << _PageShift)
}