aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-02-18 16:40:31 -0500
committerAustin Clements <austin@google.com>2015-02-19 02:47:45 +0000
commit1ae124b5ff38045008402b51017c8303eef2cda1 (patch)
tree88e86f92698d15379001b86a40eea3381f6e6146
parent95ab84a34f67742b59227e6c7b45d287071d87b0 (diff)
downloadgo-1ae124b5ff38045008402b51017c8303eef2cda1.tar.gz
go-1ae124b5ff38045008402b51017c8303eef2cda1.zip
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/5230 Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--src/runtime/mgc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index 1a3e70fcdd..7d68d5bf5f 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -494,9 +494,9 @@ func gcDrain(wbuf *workbuf) {
// gcDrainN scans n objects starting with those in wbuf, blackening
// grey objects.
//go:nowritebarrier
-func gcDrainN(wbuf *workbuf, n uintptr) *workbuf {
+func gcDrainN(wbuf *workbuf, n int) *workbuf {
checknocurrentwbuf()
- for i := uintptr(0); i < n; i++ {
+ for i := 0; i < n; i++ {
if wbuf.nobj == 0 {
putempty(wbuf, 544)
wbuf = trygetfull(545)
@@ -817,7 +817,7 @@ func gchelpwork() {
wbuf = trygetfull(1228)
}
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.nobj != 0 {
putfull(wbuf, 1175)