]> Cypherpunks repositories - gostls13.git/commit
runtime: simplify free count calculation in (un)cacheSpan
authorAustin Clements <austin@google.com>
Tue, 25 Sep 2018 21:24:30 +0000 (17:24 -0400)
committerAustin Clements <austin@google.com>
Tue, 9 Oct 2018 18:20:23 +0000 (18:20 +0000)
commit416804f3e24b25cf3e291fbbe5857cc28644a852
tree702cc815d0b922363994687bf1f89afaab6e50c9
parent70d7e96c7850d141ae48e99f02a397aed1bc474b
runtime: simplify free count calculation in (un)cacheSpan

For unclear reasons, cacheSpan and uncacheSpan compute the number of
elements in a span by dividing its size by the element size. This
number is simply available in the mspan structure, so just use it.

Change-Id: If2e5de6ecec39befd3324bf1da4a275ad000932f
Reviewed-on: https://go-review.googlesource.com/c/138656
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/mcentral.go