Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: test/cctest/test-spaces.cc

Issue 1325853003: [heap,cctest] Fix CodeRange tests that call AllocateRawMemory directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix 2nd half of test-spaces/Regress3540 ;) Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-alloc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-spaces.cc
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc
index 292b27fd00cad41a8057f10bf98c8e31d7b0ed03..a744bb79a7d4658acd5209158b021a4095d8c48e 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -222,16 +222,23 @@ TEST(Regress3540) {
v8::internal::MemoryAllocator::CodePageAreaSize())) {
return;
}
+
Address address;
size_t size;
+ size_t request_size = code_range_size - 2 * pageSize;
address = code_range->AllocateRawMemory(
- code_range_size - 2 * pageSize, code_range_size - 2 * pageSize, &size);
+ request_size, request_size - (2 * MemoryAllocator::CodePageGuardSize()),
+ &size);
CHECK(address != NULL);
+
Address null_address;
size_t null_size;
+ request_size = code_range_size - pageSize;
null_address = code_range->AllocateRawMemory(
- code_range_size - pageSize, code_range_size - pageSize, &null_size);
+ request_size, request_size - (2 * MemoryAllocator::CodePageGuardSize()),
+ &null_size);
CHECK(null_address == NULL);
+
code_range->FreeRawMemory(address, size);
delete code_range;
memory_allocator->TearDown();
« no previous file with comments | « test/cctest/test-alloc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698