Ensure enough space is allocated for structs with a FlexArray

This commit is contained in:
Chris Robinson 2020-08-15 23:53:43 -07:00
parent 23259b48dd
commit 34b29a48a4

View File

@ -47,7 +47,10 @@ enum FamCount : size_t { };
#define DEF_FAM_NEWDEL(T, FamMem) \
static constexpr size_t Sizeof(size_t count) noexcept \
{ return decltype(FamMem)::Sizeof(count, offsetof(T, FamMem)); } \
{ \
return std::max<size_t>(sizeof(T), \
decltype(FamMem)::Sizeof(count, offsetof(T, FamMem))); \
} \
\
void *operator new(size_t /*size*/, FamCount count) \
{ \