Bug 829954 - Part 1: Make AlignedArray fallible. r=jrmuizel a=akeybl
authorBas Schouten <bschouten@mozilla.com>
Tue, 04 Jun 2013 03:13:53 +0200
changeset 137752 e8c07784527f961cf27b1409fda2ee5144fa98e1
parent 137751 24b0907a5df49a44d9d7a14bfa20eaf0cc89d4fd
child 137753 80d4a7fac73e1ff7d20053fcff2a2eacca938308
push id2545
push userbschouten@mozilla.com
push dateWed, 05 Jun 2013 03:18:36 +0000
treeherdermozilla-beta@80d4a7fac73e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, akeybl
bugs829954
milestone22.0
Bug 829954 - Part 1: Make AlignedArray fallible. r=jrmuizel a=akeybl
gfx/2d/Tools.h
--- a/gfx/2d/Tools.h
+++ b/gfx/2d/Tools.h
@@ -105,17 +105,17 @@ struct AlignedArray
   {
     delete [] mStorage;
     mStorage = mPtr = nullptr;
   }
 
   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) +
         (alignment - (uintptr_t(mStorage) % alignment)));
     } else {
       mPtr = mStorage;
     }
   }