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

Unified Diff: test/cctest/test-alloc.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/cctest.status ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index d8000fde2046fb818fa591783a17e94ae22213ad..1ac0adde0f78cc65e75930387580f59a0227cbd7 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -224,9 +224,12 @@ TEST(CodeRange) {
(Page::kMaxRegularHeapObjectSize << (Pseudorandom() % 3)) +
Pseudorandom() % 5000 + 1;
size_t allocated = 0;
- Address base = code_range.AllocateRawMemory(requested,
- requested,
- &allocated);
+
+ // The request size has to be at least 2 code guard pages larger than the
+ // actual commit size.
+ Address base = code_range.AllocateRawMemory(
+ requested, requested - (2 * MemoryAllocator::CodePageGuardSize()),
+ &allocated);
CHECK(base != NULL);
blocks.Add(::Block(base, static_cast<int>(allocated)));
current_allocated += static_cast<int>(allocated);
« no previous file with comments | « test/cctest/cctest.status ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698