Commit 1ae124b5 authored by Austin Clements's avatar Austin Clements

runtime: make gcDrainN take an int instead of uintptr

Nit.  There's no reason to take a uintptr and doing so just requires
casts in annoying places.

Change-Id: Ifeb9638c6d94eae619c490930cf724cc315680ba
Reviewed-on: https://go-review.googlesource.com/5230Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent 95ab84a3
...@@ -494,9 +494,9 @@ func gcDrain(wbuf *workbuf) { ...@@ -494,9 +494,9 @@ func gcDrain(wbuf *workbuf) {
// gcDrainN scans n objects starting with those in wbuf, blackening // gcDrainN scans n objects starting with those in wbuf, blackening
// grey objects. // grey objects.
//go:nowritebarrier //go:nowritebarrier
func gcDrainN(wbuf *workbuf, n uintptr) *workbuf { func gcDrainN(wbuf *workbuf, n int) *workbuf {
checknocurrentwbuf() checknocurrentwbuf()
for i := uintptr(0); i < n; i++ { for i := 0; i < n; i++ {
if wbuf.nobj == 0 { if wbuf.nobj == 0 {
putempty(wbuf, 544) putempty(wbuf, 544)
wbuf = trygetfull(545) wbuf = trygetfull(545)
...@@ -817,7 +817,7 @@ func gchelpwork() { ...@@ -817,7 +817,7 @@ func gchelpwork() {
wbuf = trygetfull(1228) wbuf = trygetfull(1228)
} }
if wbuf != nil { if wbuf != nil {
wbuf = gcDrainN(wbuf, uintptr(len(wbuf.obj))) // drain upto one buffer's worth of objects wbuf = gcDrainN(wbuf, len(wbuf.obj)) // drain upto one buffer's worth of objects
if wbuf != nil { if wbuf != nil {
if wbuf.nobj != 0 { if wbuf.nobj != 0 {
putfull(wbuf, 1175) putfull(wbuf, 1175)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment