gfx/angle/angle-abort-on-oom-in-preprocessor.patch
author Chris Jones <jones.chris.g@gmail.com>
Mon, 19 Nov 2012 09:58:38 -0800
changeset 113713 cf8750abee06cde395c659f8ecd8ae019d7512e3
parent 102261 c2c60b40fa7fc705db72242c97d49a82403d50ee
permissions -rw-r--r--
Bug 804852: Support for the hwc implementation of Composer2D. r=mattwoodrow,mwu,roc sr=roc This is a rollup of the following patches part 0: Add a dynamic cast to ColorLayer* part 1: Add a Composer2D interface to enable implementations to more efficiently compose layer trees part 2: Let widgets expose Composer2Ds, if they have them part 3: Expose a layers ogl "friend" API that Composer2D will consume part 4: Hook Composer2D into the LayerManagerOGL rendering pipeline part 5: Implement all the goop to let widget/gonk use a Composer2D (HwcComposer2D)

# HG changeset patch
# Parent 11023ab3d23865b71678e9a4b22a45646ec0c0f0
diff --git a/gfx/angle/src/compiler/preprocessor/atom.c b/gfx/angle/src/compiler/preprocessor/atom.c
--- a/gfx/angle/src/compiler/preprocessor/atom.c
+++ b/gfx/angle/src/compiler/preprocessor/atom.c
@@ -327,22 +327,17 @@ static int GrowAtomTable(AtomTable *atab
             newmap = realloc(atable->amap, sizeof(int)*size);
             newrev = realloc(atable->arev, sizeof(int)*size);
         } else {
             newmap = malloc(sizeof(int)*size);
             newrev = malloc(sizeof(int)*size);
             atable->size = 0;
         }
         if (!newmap || !newrev) {
-            /* failed to grow -- error */
-            if (newmap)
-                atable->amap = newmap;
-            if (newrev)
-                atable->arev = newrev;
-            return -1;
+            abort();
         }
         memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));
         memset(&newrev[atable->size], 0, (size - atable->size) * sizeof(int));
         atable->amap = newmap;
         atable->arev = newrev;
         atable->size = size;
     }
     return 0;