]> Cypherpunks repositories - gostls13.git/commit
runtime: implement addrRanges.findSucc with a binary search
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 14 Jul 2020 21:45:16 +0000 (21:45 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 26 Oct 2020 22:00:15 +0000 (22:00 +0000)
commit76bce1dd52b0c2a06d48bf7db4e89e8dec47c507
tree2a45b7cd09dd1518670709cc14835989ebac0e1d
parent0eb52ac2501396874a4e885bf13994773ba1acfe
runtime: implement addrRanges.findSucc with a binary search

This change modifies addrRanges.findSucc to more efficiently find the
successor range in an addrRanges by using a binary search to narrow down
large addrRanges and iterate over no more than 8 addrRanges.

This change makes the runtime more robust against systems that may
aggressively randomize the address space mappings it gives the runtime
(e.g. Fuchsia).

For #40191.

Change-Id: If529df2abd2edb1b1496d8690ddd284ecd7138c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/242679
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mranges.go