[PATCH] D49163: ADT: Shrink SmallVector size 0 to 16B on 64-bit platforms

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 14:52:16 PDT 2018


rnk added a comment.

@rsmith, what's the least bad way to do what SmallVector is trying to do?



================
Comment at: llvm/include/llvm/ADT/SmallVector.h:90
+        reinterpret_cast<const char *>(this) +
+        offsetof(SmallVectorAlignmentAndSize<T>, FirstEl)));
+  }
----------------
This assumes that base classes are laid out more or less the same as fields, but we were already assuming that there wouldn't be padding between FirstEl and InlineElts, so this seems like an improvement.


https://reviews.llvm.org/D49163





More information about the llvm-commits mailing list