aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorIlya Tocar <ilya.tocar@intel.com>2017-09-20 13:09:08 -0500
committerIlya Tocar <ilya.tocar@intel.com>2017-09-20 20:27:13 +0000
commit101fbc2c829beadacefdad1c852e0888e2f16d4d (patch)
treec2de035c64aaf9199ca6ccb443631bad5aec047e /src/runtime/malloc.go
parent55ac5b50b079b14bcab4dc1a971d84516cd4bf75 (diff)
downloadgo-101fbc2c829beadacefdad1c852e0888e2f16d4d.tar.xz
runtime: make nextFreeFast inlinable
https://golang.org/cl/22598 made nextFreeFast inlinable. But during https://golang.org/cl/63611 it was discovered, that it is no longer inlinable. Reduce number of statements below inlining threshold to make it inlinable again. Also update tests, to prevent regressions. Doesn't reduce readability. Change-Id: Ia672784dd48ed3b1ab46e390132f1094fe453de5 Reviewed-on: https://go-review.googlesource.com/65030 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 274ab537fc..d68ebcc5d2 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -529,9 +529,8 @@ func nextFreeFast(s *mspan) gclinkptr {
}
s.allocCache >>= uint(theBit + 1)
s.freeindex = freeidx
- v := gclinkptr(result*s.elemsize + s.base())
s.allocCount++
- return v
+ return gclinkptr(result*s.elemsize + s.base())
}
}
return 0