This is an archive of the discontinued LLVM Phabricator instance.

[scudo][standalone] Use BatchClassId in drain rather than 0
ClosedPublic

Authored by cryptoad on Apr 7 2021, 12:40 PM.

Details

Summary

D99763 fixed SizeClassAllocatorLocalCache::drain but with the
assumption that BatchClassId is 0 - which is currently true. I would
rather not make the assumption so that if we ever change the ID of
the batch class, the loop would still work. Since BatchClassId is
used more often in local_cache.h, introduce a constant so that we
don't have to specify SizeClassMap:: every time.

Diff Detail

Event Timeline

cryptoad requested review of this revision.Apr 7 2021, 12:40 PM
cryptoad created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2021, 12:40 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Apr 9 2021, 1:35 PM
This revision is now accepted and ready to land.Apr 9 2021, 1:35 PM