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

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: 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
Index: test/cctest/test-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index d8000fde2046fb818fa591783a17e94ae22213ad..4a089f62c472f77f0f6027966a20753e1c00a47e 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 then the
Michael Starzinger 2015/09/01 15:08:53 nit: s/then/than/
Michael Lippautz 2015/09/01 15:19:35 Done.
+ // 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);

Powered by Google App Engine
This is Rietveld 408576698