[PATCH] D101018: scudo: Use a table to look up the LSB for computing the odd/even mask. NFCI.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 21 21:51:50 PDT 2021


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

In the most common case we call computeOddEvenMaskForPointerMaybe()
from quarantineOrDeallocateChunk(), in which case we need to look up
the class size from the SizeClassMap in order to compute the LSB. Since
we need to do a lookup anyway, we may as well look up the LSB itself
and avoid computing it every time.

While here, switch to a slightly more efficient way of computing the
odd/even mask.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101018

Files:
  compiler-rt/lib/scudo/standalone/combined.h
  compiler-rt/lib/scudo/standalone/size_class_map.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101018.339466.patch
Type: text/x-patch
Size: 3715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210422/8729d559/attachment.bin>


More information about the llvm-commits mailing list