[PATCH] D90884: [SmallVector] Add a default small size.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 14:33:53 PST 2020


mehdi_amini added a comment.

Seems like it'll always have a default payload equivalent of 6 pointers? Maybe you can document this? Also that makes the vector 72B, which isn't cache line aligned, should we make it 64 or 128 instead?

I'm not sure it makes sense to every get a default of a very small N in general. I guess a default like here makes sense for smaller object, what about `static_assert` if `sizeof(T)>sizeof(void*)`?



================
Comment at: llvm/include/llvm/ADT/SmallVector.h:904
+  // Discount the size of the header itself when calculating the maximum inline
+  // bytes, so subtract one fromthe multiplier.
+  size_t MaxInlineBytes = (kDefaultSmallSizeHeaderSizeMultiplier - 1) *
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90884



More information about the llvm-commits mailing list