From 101fbc2c829beadacefdad1c852e0888e2f16d4d Mon Sep 17 00:00:00 2001 From: Ilya Tocar Date: Wed, 20 Sep 2017 13:09:08 -0500 Subject: runtime: make nextFreeFast inlinable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 TryBot-Result: Gobot Gobot Reviewed-by: Daniel Martí --- src/runtime/malloc.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/runtime/malloc.go') 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 -- cgit v1.3