[scudo] Simplify markFreeBlocks
authorChia-hung Duan <chiahungduan@google.com>
Sat, 4 Mar 2023 01:25:18 +0000 (01:25 +0000)
committerChia-hung Duan <chiahungduan@google.com>
Tue, 7 Mar 2023 21:55:04 +0000 (21:55 +0000)
commit657d297a92aed929d37c8d7b148a6e848bc182df
tree1fe1b4d1a5f9f09295ddccbf2384705c31b3d378
parentcc009334ebd86b61def72284f9c6b36d5b7d77b3
[scudo] Simplify markFreeBlocks

With memory group, we always mark the free blocks from the same region.
Therefore, we don't need to calculate the offset from base and determine
the region index. Also improve the way we deal with the last block in
the region so that the loop body is simpler.

Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D143303
compiler-rt/lib/scudo/standalone/primary32.h
compiler-rt/lib/scudo/standalone/primary64.h
compiler-rt/lib/scudo/standalone/release.h
compiler-rt/lib/scudo/standalone/tests/release_test.cpp