[PATCH] D64077: [ELF] Assert sizeof(SymbolUnion) <= 80

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 00:12:46 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365443: [ELF] Assert sizeof(SymbolUnion) <= 80 (authored by MaskRay, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64077/new/

https://reviews.llvm.org/D64077

Files:
  lld/trunk/ELF/Symbols.h


Index: lld/trunk/ELF/Symbols.h
===================================================================
--- lld/trunk/ELF/Symbols.h
+++ lld/trunk/ELF/Symbols.h
@@ -460,6 +460,11 @@
   alignas(LazyObject) char F[sizeof(LazyObject)];
 };
 
+// It is important to keep the size of SymbolUnion small for performance and
+// memory usage reasons. 80 bytes is a soft limit based on the size of Defined
+// on a 64-bit system.
+static_assert(sizeof(SymbolUnion) <= 80, "SymbolUnion too large");
+
 template <typename T> struct AssertSymbol {
   static_assert(std::is_trivially_destructible<T>(),
                 "Symbol types must be trivially destructible");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64077.208604.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190709/abc460eb/attachment.bin>


More information about the llvm-commits mailing list