From 27cb748ee155c8f211b65ba08fa6685461f95c8a Mon Sep 17 00:00:00 2001 From: Morgan Phillips Date: Thu, 28 Jan 2016 10:07:14 -0600 Subject: [PATCH] Bug 1238582 - Skip simulated OOM check in the case where we're growing within reserved space; r=Waldo --- mfbt/Vector.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mfbt/Vector.h b/mfbt/Vector.h index 4461242a946..bf7531c70b7 100644 --- a/mfbt/Vector.h +++ b/mfbt/Vector.h @@ -972,7 +972,13 @@ Vector::growBy(size_t aIncr) return false; } } else if (aIncr + mLength > N) { - if (!allocPolicy().checkSimulatedOOM()) { + bool checkSimulatedOOM = +#ifdef DEBUG + aIncr + mLength > mReserved; +#else + true; +#endif + if (checkSimulatedOOM && !allocPolicy().checkSimulatedOOM()) { return false; } }