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

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

Issue 23903008: Drop OS::IsOutsideAllocatedSpace() and move the tracking to the MemoryAllocator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix invalid calculation of committed memory boundaries. Created 7 years, 3 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 | « src/v8.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-alloc.cc
diff --git a/test/cctest/test-alloc.cc b/test/cctest/test-alloc.cc
index e6e3bd1cc4b3216f65d1974965a2367634f534a5..670da58a150086bd6ca0d67b7255f17a51fde192 100644
--- a/test/cctest/test-alloc.cc
+++ b/test/cctest/test-alloc.cc
@@ -186,10 +186,9 @@ class Block {
TEST(CodeRange) {
const int code_range_size = 32*MB;
- OS::SetUp();
- Isolate::Current()->InitializeLoggingAndCounters();
- CodeRange* code_range = new CodeRange(Isolate::Current());
- code_range->SetUp(code_range_size);
+ CcTest::InitializeVM();
+ CodeRange code_range(reinterpret_cast<Isolate*>(CcTest::isolate()));
+ code_range.SetUp(code_range_size);
int current_allocated = 0;
int total_allocated = 0;
List<Block> blocks(1000);
@@ -205,9 +204,9 @@ TEST(CodeRange) {
(Page::kMaxNonCodeHeapObjectSize << (Pseudorandom() % 3)) +
Pseudorandom() % 5000 + 1;
size_t allocated = 0;
- Address base = code_range->AllocateRawMemory(requested,
- requested,
- &allocated);
+ Address base = code_range.AllocateRawMemory(requested,
+ requested,
+ &allocated);
CHECK(base != NULL);
blocks.Add(Block(base, static_cast<int>(allocated)));
current_allocated += static_cast<int>(allocated);
@@ -215,7 +214,7 @@ TEST(CodeRange) {
} else {
// Free a block.
int index = Pseudorandom() % blocks.length();
- code_range->FreeRawMemory(blocks[index].base, blocks[index].size);
+ code_range.FreeRawMemory(blocks[index].base, blocks[index].size);
current_allocated -= blocks[index].size;
if (index < blocks.length() - 1) {
blocks[index] = blocks.RemoveLast();
@@ -225,6 +224,5 @@ TEST(CodeRange) {
}
}
- code_range->TearDown();
- delete code_range;
+ code_range.TearDown();
}
« no previous file with comments | « src/v8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698