Android 11.0.0 Release 32 (RQ2A.210305.006)
[scudo][standalone] Skip irrelevant regions during release

With the 'new' way of releasing on 32-bit, we iterate through all the
regions in between `First` and `Last`, which covers regions that do not
belong to the class size we are working with. This is effectively wasted
cycles.

With this change, we add a `SkipRegion` lambda to `releaseFreeMemoryToOS`
that will allow the release function to know when to skip a region.
For the 64-bit primary, since we are only working with 1 region, we never
skip.

Reviewed By: hctim

Differential Revision: https://reviews.llvm.org/D86399

Bug: 164309199

Test: Ran all unit tests (bionic, libmemunreachable, scudo).
Test: Ran all perf benchmarks before and after and verified no decrease.

GitOrigin-RevId: bd5ca4f0ed4adfa29150c18a621acb3e71d41450
Change-Id: I1fcbe91c117f4e4835f1dabe05d4c47f9604d015
Merged-In: I1fcbe91c117f4e4835f1dabe05d4c47f9604d015
(cherry picked from commit bcd746b334c91b8c2b925a5cb8f91b846edb918d)
4 files changed