mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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:
parent
2ac8bdc52a
commit
aed861038f
2 changed files with 13 additions and 12 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue