Merge pull request #1989 from adamcalhoon/really-fix-placement-new-alignment
Fix the alignment of placement new buffer for GenericValue.
This commit is contained in:
commit
0d78b1ce93
@ -1235,8 +1235,8 @@ public:
|
|||||||
// return NullValue;
|
// return NullValue;
|
||||||
|
|
||||||
// Use static buffer and placement-new to prevent destruction
|
// Use static buffer and placement-new to prevent destruction
|
||||||
static char buffer[sizeof(GenericValue)];
|
static GenericValue buffer;
|
||||||
return *new (buffer) GenericValue();
|
return *new (reinterpret_cast<char *>(&buffer)) GenericValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template <typename SourceAllocator>
|
template <typename SourceAllocator>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user