Bug 719776 - Part 4: Do not depend upon mozalloc inside Azure. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Thu, 12 Apr 2012 02:03:07 +0200
changeset 94800 f27e0a7e5809528f5c10f616d8c891121b9cd244
parent 94799 a964ce19e78f0e29b7782127d7f515f2721889eb
child 94801 56aa3326470cb6ce718f5437c832bfa1cad57df1
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs719776
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 719776 - Part 4: Do not depend upon mozalloc inside Azure. r=jrmuizel
gfx/2d/UserData.h
--- a/gfx/2d/UserData.h
+++ b/gfx/2d/UserData.h
@@ -34,17 +34,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef MOZILLA_GFX_USERDATA_H_
 #define MOZILLA_GFX_USERDATA_H_
 
 #include <stdlib.h>
-#include "mozilla/mozalloc.h"
+#include "mozilla/Assertions.h"
 
 namespace mozilla {
 namespace gfx {
 
 struct UserDataKey {
   int unused;
 };
 
@@ -60,17 +60,21 @@ public:
   {
     // XXX we should really warn if user data with key has already been added,
     // since in that case Get() will return the old user data!
 
     // We could keep entries in a std::vector instead of managing it by hand
     // but that would propagate an stl dependency out which we'd rather not
     // do (see bug 666609). Plus, the entries array is expect to stay small
     // so doing a realloc everytime we add a new entry shouldn't be too costly
-    entries = static_cast<Entry*>(moz_xrealloc(entries, sizeof(Entry)*(count+1)));
+    entries = static_cast<Entry*>(realloc(entries, sizeof(Entry)*(count+1)));
+
+    if (!entries) {
+      MOZ_CRASH();
+    }
 
     entries[count].key      = key;
     entries[count].userData = userData;
     entries[count].destroy  = destroy;
 
     count++;
   }