Commit 93d84f28 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

Revert "[Memory] Experiment to try using regular version of 'new T[]'."

This reverts commit bec2b4d2.

Reason for revert: NewArrayOOM fails.

Original change's description:
> [Memory] Experiment to try using regular version of 'new T[]'.
> 
> - Use normal new, vs. nothrow new.
> - Modify NewArray to have only 1 invocation of new.
> 
> Bug: chromium:752056
> Change-Id: I1a2fb3626264b1bf647af9227d55e9b54e44e8b6
> Reviewed-on: https://chromium-review.googlesource.com/600895
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Bill Budge <bbudge@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#47173}

TBR=bbudge@chromium.org,mlippautz@chromium.org

Change-Id: I881f3b75209714d11d93fae6268171ffa9cc47a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:752056
Reviewed-on: https://chromium-review.googlesource.com/602847Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47174}
parent bec2b4d2
......@@ -34,13 +34,13 @@ class V8_EXPORT_PRIVATE Malloced {
template <typename T>
T* NewArray(size_t size) {
int retries = 0;
while (true) {
T* result = new T[size];
if (result != nullptr) return result;
if (retries++ == 1) FatalProcessOutOfMemory("NewArray");
T* result = new (std::nothrow) T[size];
if (result == nullptr) {
V8::GetCurrentPlatform()->OnCriticalMemoryPressure();
result = new (std::nothrow) T[size];
if (result == nullptr) FatalProcessOutOfMemory("NewArray");
}
return result;
}
template <typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment