Bug 829954 - Part 1: Make AlignedArray fallible. r=jrmuizel

This commit is contained in:
Bas Schouten 2013-06-04 03:13:53 +02:00
parent 96667a8d5a
commit 919d149d6f

View File

@ -110,7 +110,7 @@ struct AlignedArray
MOZ_ALWAYS_INLINE void Realloc(size_t aSize)
{
delete [] mStorage;
mStorage = new T[aSize + (alignment - 1)];
mStorage = new (std::nothrow) T[aSize + (alignment - 1)];
if (uintptr_t(mStorage) % alignment) {
// Our storage does not start at a <alignment>-byte boundary. Make sure mData does!
mPtr = (uint32_t*)(uintptr_t(mStorage) +