This is an archive of the discontinued LLVM Phabricator instance.

scudo: Use a table to look up the LSB for computing the odd/even mask. NFCI.
ClosedPublic

Authored by pcc on Apr 21 2021, 9:51 PM.

Details

Summary

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.

Diff Detail

Event Timeline

pcc requested review of this revision.Apr 21 2021, 9:51 PM
pcc created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:51 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
pcc updated this revision to Diff 339467.Apr 21 2021, 9:54 PM

Fix build

cryptoad accepted this revision.Apr 22 2021, 8:07 AM
This revision is now accepted and ready to land.Apr 22 2021, 8:07 AM