This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Make Vector() constexpr
ClosedPublic

Authored by cryptoad on Aug 2 2021, 1:40 PM.

Details

Summary

A Vector that doesn't require an initial reserve() (eg: with a
default, or small enough capacity) can have a constant initializer.

This changes the code in a few places to make that possible:

  • mark a few other functions as constexpr
  • do without any reinterpret_cast
  • allow to skip reserve from init

Diff Detail

Event Timeline

cryptoad requested review of this revision.Aug 2 2021, 1:40 PM
cryptoad created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 1:40 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Aug 2 2021, 1:45 PM
This revision is now accepted and ready to land.Aug 2 2021, 1:45 PM
This revision was landed with ongoing or failed builds.Aug 3 2021, 8:25 AM
This revision was automatically updated to reflect the committed changes.