Bug 1238582 - Skip simulated OOM check in the case where we're growing within reserved space; r=Waldo

This commit is contained in:
Morgan Phillips 2016-01-28 10:07:14 -06:00
parent 9fe43fddfd
commit 27cb748ee1

View File

@ -972,7 +972,13 @@ Vector<T, N, AP>::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;
}
}