This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Do not mmap FlagParser::flags_
ClosedPublic

Authored by leonardchan on Aug 24 2023, 2:14 PM.

Details

Summary

Instead, make it a static array that's part of the FlagParser. The advantage this has is helping reduce fragmentation from needing to anonymously mmap this array via the LowLevelAllocator. This will instead place the array on the stack. Functionally, the only difference is that the array will not be zero-initialized, but all used elements are explicitly initialized via the flag handlers.

Diff Detail

Event Timeline

leonardchan created this revision.Aug 24 2023, 2:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2023, 2:14 PM
Herald added a subscriber: Enna1. · View Herald Transcript
leonardchan requested review of this revision.Aug 24 2023, 2:14 PM
leonardchan edited the summary of this revision. (Show Details)Aug 24 2023, 2:15 PM
MaskRay accepted this revision.EditedAug 26 2023, 4:44 PM

LGTM. I think consuming max * sizeof(Flag) stack space should be fine.

This revision is now accepted and ready to land.Aug 26 2023, 4:44 PM
vitalybuka accepted this revision.Aug 27 2023, 5:46 PM
This revision was landed with ongoing or failed builds.Aug 29 2023, 12:08 PM
This revision was automatically updated to reflect the committed changes.