…engedBits' chunk iteration
Both ReadMemStatsSlow and CheckScavengedBits iterate over the page
allocator's chunks but don't actually check if they exist. During the
development process the chunks index became sparse, so now this was a
possibility. If the runtime tests' heap is sparse we might end up
segfaulting in either one of these functions, though this will generally
be very rare.
The pattern here to return nil for a nonexistent chunk is also useful
elsewhere, so this change introduces tryChunkOf which won't throw, but
might return nil. It also updates the documentation of chunkOf.
Run-TryBot: Michael Knyszek <email@example.com>
Reviewed-by: Keith Randall <firstname.lastname@example.org>
TryBot-Result: Gobot Gobot <email@example.com>
(cherry picked from commit 34835df)
Run-TryBot: Dmitri Shuralyov <firstname.lastname@example.org>
Reviewed-by: Michael Knyszek <email@example.com>