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

Unified Diff: trunk/Source/platform/heap/HeapTest.cpp

Issue 1184613004: Revert 196997 "Oilpan: Defer reusing freed memory for one GC cycle" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 years, 6 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 | « trunk/Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/platform/heap/HeapTest.cpp
===================================================================
--- trunk/Source/platform/heap/HeapTest.cpp (revision 197018)
+++ trunk/Source/platform/heap/HeapTest.cpp (working copy)
@@ -1840,37 +1840,6 @@
EXPECT_EQ(1, SimpleFinalizedObject::s_destructorCalls);
}
-#if ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
-TEST(HeapTest, FreelistReuse)
-{
- clearOutOldGarbage();
-
- for (int i = 0; i < 100; i++)
- new IntWrapper(i);
- IntWrapper* p1 = new IntWrapper(100);
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
- // In non-production builds, we delay reusing freed memory for at least
- // one GC cycle.
- for (int i = 0; i < 100; i++) {
- IntWrapper* p2 = new IntWrapper(i);
- EXPECT_NE(p1, p2);
- }
-
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
- // Now the freed memory in the first GC should be reused.
- bool reusedMemoryFound = false;
- for (int i = 0; i < 10000; i++) {
- IntWrapper* p2 = new IntWrapper(i);
- if (p1 == p2) {
- reusedMemoryFound = true;
- break;
- }
- }
- EXPECT_TRUE(reusedMemoryFound);
-}
-#endif
-
#if ENABLE(LAZY_SWEEPING)
TEST(HeapTest, LazySweepingPages)
{
@@ -1893,22 +1862,11 @@
{
clearOutOldGarbage();
- // Create free lists that can be reused for IntWrappers created in
- // LargeHeapObject::create().
- Persistent<IntWrapper> p1 = new IntWrapper(1);
- for (int i = 0; i < 100; i++) {
- new IntWrapper(i);
- }
- Persistent<IntWrapper> p2 = new IntWrapper(2);
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
- Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, Heap::ForcedGC);
-
LargeHeapObject::s_destructorCalls = 0;
EXPECT_EQ(0, LargeHeapObject::s_destructorCalls);
for (int i = 0; i < 10; i++)
LargeHeapObject::create();
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithoutSweep, Heap::ForcedGC);
- EXPECT_EQ(0, LargeHeapObject::s_destructorCalls);
for (int i = 0; i < 10; i++) {
LargeHeapObject::create();
EXPECT_EQ(i + 1, LargeHeapObject::s_destructorCalls);
« no previous file with comments | « trunk/Source/platform/heap/Heap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698