27 sizeof(
unsigned) * 2 +
sizeof(
void *),
28 "wasted space in SmallVector size 0");
30 "wrong alignment for 16-byte aligned T");
32 "wrong alignment for 32-byte aligned T");
34 "missing padding for 16-byte aligned T");
36 "missing padding for 32-byte aligned T");
38 sizeof(
unsigned) * 2 +
sizeof(
void *) * 2,
39 "wasted space in SmallVector size 1");
46 if (MinCapacity > UINT32_MAX)
49 size_t NewCapacity = 2 * capacity() + 1;
51 std::min(
std::max(NewCapacity, MinCapacity),
size_t(UINT32_MAX));
54 if (BeginX == FirstEl) {
61 NewElts =
safe_realloc(this->BeginX, NewCapacity * TSize);
64 this->BeginX = NewElts;
65 this->Capacity = NewCapacity;
void grow_pod(void *FirstEl, size_t MinCapacity, size_t TSize)
This is an implementation of the grow() method which only works on POD-like data types and is out of ...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
This class represents lattice values for constants.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_realloc(void *Ptr, size_t Sz)
void report_bad_alloc_error(const char *Reason, bool GenCrashDiag=true)
Reports a bad alloc error, calling any user defined bad alloc error handler.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...