[PATCH] D92966: scudo: Shrink secondary header and cache entry size by a word on Linux. NFCI.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 13:33:57 PST 2020


pcc created this revision.
pcc added reviewers: hctim, cryptoad, eugenis.
pcc requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92966

Files:
  compiler-rt/lib/scudo/standalone/secondary.h


Index: compiler-rt/lib/scudo/standalone/secondary.h
===================================================================
--- compiler-rt/lib/scudo/standalone/secondary.h
+++ compiler-rt/lib/scudo/standalone/secondary.h
@@ -31,7 +31,7 @@
   uptr BlockEnd;
   uptr MapBase;
   uptr MapSize;
-  MapPlatformData Data;
+  [[no_unique_address]] MapPlatformData Data;
 };
 
 constexpr uptr getHeaderSize() {
@@ -232,7 +232,7 @@
     uptr BlockEnd;
     uptr MapBase;
     uptr MapSize;
-    MapPlatformData Data;
+    [[no_unique_address]] MapPlatformData Data;
     u64 Time;
   };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92966.310640.patch
Type: text/x-patch
Size: 577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201209/f876dc61/attachment.bin>


More information about the llvm-commits mailing list