aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/mpallocbits.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-02-05 14:33:27 -0800
committerIan Lance Taylor <iant@golang.org>2020-02-15 09:14:10 -0800
commit0b3c2eed35d608d6541ecf004a9576b4eae0b4ef (patch)
treec92c05d53eb054d8085d069800f4e9b586fef5a3 /libgo/go/runtime/mpallocbits.go
parent17edb3310d8ce9d5f6c9e53f6c1f7d611c2a5a41 (diff)
downloadgcc-0b3c2eed35d608d6541ecf004a9576b4eae0b4ef.zip
gcc-0b3c2eed35d608d6541ecf004a9576b4eae0b4ef.tar.gz
gcc-0b3c2eed35d608d6541ecf004a9576b4eae0b4ef.tar.bz2
libgo: update to Go1.14rc1 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/218017
Diffstat (limited to 'libgo/go/runtime/mpallocbits.go')
-rw-r--r--libgo/go/runtime/mpallocbits.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/libgo/go/runtime/mpallocbits.go b/libgo/go/runtime/mpallocbits.go
index 9d01ff8..a801134 100644
--- a/libgo/go/runtime/mpallocbits.go
+++ b/libgo/go/runtime/mpallocbits.go
@@ -202,17 +202,11 @@ func (b *pallocBits) summarize() pallocSum {
// If find fails to find any free space, it returns an index of ^uint(0) and
// the new searchIdx should be ignored.
//
-// The returned searchIdx is always the index of the first free page found
-// in this bitmap during the search, except if npages == 1, in which
-// case it will be the index just after the first free page, because the
-// index returned as the first result is assumed to be allocated and so
-// represents a minor optimization for that case.
+// Note that if npages == 1, the two returned values will always be identical.
func (b *pallocBits) find(npages uintptr, searchIdx uint) (uint, uint) {
if npages == 1 {
addr := b.find1(searchIdx)
- // Return a searchIdx of addr + 1 since we assume addr will be
- // allocated.
- return addr, addr + 1
+ return addr, addr
} else if npages <= 64 {
return b.findSmallN(npages, searchIdx)
}