Index: test/cctest/test-spaces.cc |
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc |
index d09c128d177a256dd155cd5d55e2bc3d63ce5f33..5c01f5bc281d4ca2e1da51b6f819933300d958b1 100644 |
--- a/test/cctest/test-spaces.cc |
+++ b/test/cctest/test-spaces.cc |
@@ -27,6 +27,7 @@ |
#include <stdlib.h> |
+#include "src/base/platform/platform.h" |
#include "src/snapshot.h" |
#include "src/v8.h" |
#include "test/cctest/cctest.h" |
@@ -212,7 +213,12 @@ TEST(Regress3540) { |
TestMemoryAllocatorScope test_allocator_scope(isolate, memory_allocator); |
CodeRange* code_range = new CodeRange(isolate); |
const size_t code_range_size = 4 * MB; |
- if (!code_range->SetUp(code_range_size)) return; |
+ if (!code_range->SetUp( |
+ code_range_size + |
+ RoundUp(v8::base::OS::CommitPageSize() * kReservedCodeRangePages, |
+ MemoryChunk::kAlignment))) { |
+ return; |
+ } |
Address address; |
size_t size; |
address = code_range->AllocateRawMemory(code_range_size - MB, |