[PATCH] D91106: [scudo][standalone] Correct min/max region indices

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 15:15:34 PST 2020


cryptoad created this revision.
cryptoad added reviewers: hctim, eugenis, pcc, cferris.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
cryptoad requested review of this revision.
Herald added a subscriber: oontvoo.

The original code to keep track of the minimum and maximum indices
of allocated 32-bit primary regions was sketchy at best.

`MinRegionIndex` & `MaxRegionIndex` were shared between all size
classes, and could (theoretically) have been updated concurrently. This
didn't materialize anywhere I could see, but still it's not proper.

This changes those min/max indices by making them class specific rather
than global: classes are locked when growing, so there is no
concurrency there. This also allows to simplify some of the 32-bit
release code, that now doesn't have to go through all the regions to
get the proper min/max. Iterate and unmap will no longer have access to
the global min/max, but they aren't used as much so this is fine.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91106

Files:
  compiler-rt/lib/scudo/standalone/primary32.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91106.303999.patch
Type: text/x-patch
Size: 5337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201109/602aa87d/attachment.bin>


More information about the llvm-commits mailing list