Index: test/cctest/cctest.h |
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h |
index 7f84c259f0c4cb1b135ae6a73d465d631d858e31..428245dcf47a7c861f2bf099eab95e0f5bc6c3cf 100644 |
--- a/test/cctest/cctest.h |
+++ b/test/cctest/cctest.h |
@@ -332,6 +332,7 @@ static inline int FlagDependentPortOffset() { |
static inline void SimulateFullSpace(v8::internal::NewSpace* space) { |
int new_linear_size = static_cast<int>( |
*space->allocation_limit_address() - *space->allocation_top_address()); |
+ if (new_linear_size == 0) return; |
v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size); |
v8::internal::FreeListNode* node = v8::internal::FreeListNode::cast(maybe); |
node->set_size(space->heap(), new_linear_size); |
@@ -340,9 +341,7 @@ static inline void SimulateFullSpace(v8::internal::NewSpace* space) { |
// Helper function that simulates a full old-space in the heap. |
static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { |
- int old_linear_size = static_cast<int>(space->limit() - space->top()); |
- space->Free(space->top(), old_linear_size); |
- space->SetTop(space->limit(), space->limit()); |
+ space->EmptyAllocationInfo(); |
space->ResetFreeList(); |
space->ClearStats(); |
} |