From 7ae652b7c0cddb8f6e04bfa6f5805baac823dd64 Mon Sep 17 00:00:00 2001 From: Youlin Feng Date: Wed, 5 Oct 2022 15:29:29 +0800 Subject: runtime: replace all uses of CtzXX with TrailingZerosXX Replace all uses of Ctz64/32/8 with TrailingZeros64/32/8, because they are the same and maybe duplicated. Also renamed CtzXX functions in 386 assembly code. Change-Id: I19290204858083750f4be589bb0923393950ae6d Reviewed-on: https://go-review.googlesource.com/c/go/+/438935 Reviewed-by: Keith Randall Reviewed-by: Bryan Mills Auto-Submit: Keith Randall TryBot-Result: Gopher Robot Reviewed-by: Keith Randall Run-TryBot: Keith Randall --- src/runtime/malloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index cece04eeca..70a13d0576 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -816,7 +816,7 @@ var zerobase uintptr // nextFreeFast returns the next free object if one is quickly available. // Otherwise it returns 0. func nextFreeFast(s *mspan) gclinkptr { - theBit := sys.Ctz64(s.allocCache) // Is there a free object in the allocCache? + theBit := sys.TrailingZeros64(s.allocCache) // Is there a free object in the allocCache? if theBit < 64 { result := s.freeindex + uintptr(theBit) if result < s.nelems { -- cgit v1.3-5-g9baa