Normally compilers will allocate space for struct fields even if the
field is an empty struct. Use the [[no_unique_address]] attribute to
suppress that behavior. This attribute that was introduced in C++20,
but compilers that do not support [[no_unique_address]] will ignore
it since it uses C++11 attribute syntax.
Differential Revision: https://reviews.llvm.org/D92966
uptr BlockEnd;
uptr MapBase;
uptr MapSize;
- MapPlatformData Data;
+ [[no_unique_address]] MapPlatformData Data;
};
constexpr uptr getHeaderSize() {
uptr BlockEnd;
uptr MapBase;
uptr MapSize;
- MapPlatformData Data;
+ [[no_unique_address]] MapPlatformData Data;
u64 Time;
};