Commit 5a1fbe24 authored by titzer's avatar titzer Committed by Commit bot

[d8] Do not try to verify zero-ness of failed virtual memory allocation.

BUG=chromium:667603
R=clemensh@chromium.org

Review-Url: https://codereview.chromium.org/2519363002
Cr-Commit-Position: refs/heads/master@{#41174}
parent d7aae405
......@@ -76,10 +76,13 @@ class ShellArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
if (RoundToPageSize(&length)) {
void* data = VirtualMemoryAllocate(length);
#if DEBUG
// In debug mode, check the memory is zero-initialized.
uint8_t* ptr = reinterpret_cast<uint8_t*>(data);
for (size_t i = 0; i < length; i++) {
DCHECK_EQ(0, ptr[i]);
if (data) {
// In debug mode, check the memory is zero-initialized.
size_t limit = length / sizeof(uint64_t);
uint64_t* ptr = reinterpret_cast<uint64_t*>(data);
for (size_t i = 0; i < limit; i++) {
DCHECK_EQ(0u, ptr[i]);
}
}
#endif
return data;
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
try {
var v65 = new ArrayBuffer(2147483647);
} catch(e) {
assertTrue(e instanceof RangeError);
}
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