#include "src/heap/cppgc/sweeper.h"
#include <algorithm>
#include "include/cppgc/allocation.h"
#include "include/cppgc/cross-thread-persistent.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/globals.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/heap-visitor.h"
#include "src/heap/cppgc/heap.h"
#include "src/heap/cppgc/object-view.h"
#include "src/heap/cppgc/page-memory.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cppgc {
namespace internal {
namespace {
size_t g_destructor_callcount;
template <size_t Size>
class GCed : public GarbageCollected<GCed<Size>> { … };
class SweeperTest : public testing::TestWithHeap { … };
}
TEST_F(SweeperTest, SweepUnmarkedNormalObject) { … }
TEST_F(SweeperTest, DontSweepMarkedNormalObject) { … }
TEST_F(SweeperTest, SweepUnmarkedLargeObject) { … }
TEST_F(SweeperTest, DontSweepMarkedLargeObject) { … }
TEST_F(SweeperTest, SweepMultipleObjectsOnPage) { … }
TEST_F(SweeperTest, SweepObjectsOnAllArenas) { … }
TEST_F(SweeperTest, SweepMultiplePagesInSingleSpace) { … }
TEST_F(SweeperTest, CoalesceFreeListEntries) { … }
namespace {
class GCInDestructor final : public GarbageCollected<GCInDestructor> { … };
}
TEST_F(SweeperTest, SweepDoesNotTriggerRecursiveGC) { … }
TEST_F(SweeperTest, UnmarkObjects) { … }
TEST_F(SweeperTest, LazySweepingDuringAllocation) { … }
TEST_F(SweeperTest, LazySweepingNormalPages) { … }
namespace {
class AllocatingFinalizer : public GarbageCollected<AllocatingFinalizer> { … };
size_t AllocatingFinalizer::destructor_callcount_ = …;
}
TEST_F(SweeperTest, AllocationDuringFinalizationIsNotSwept) { … }
TEST_F(SweeperTest, DiscardingNormalPageMemory) { … }
namespace {
class Holder final : public GarbageCollected<Holder> { … };
size_t Holder::destructor_callcount;
}
TEST_F(SweeperTest, CrossThreadPersistentCanBeClearedFromOtherThread) { … }
TEST_F(SweeperTest, WeakCrossThreadPersistentCanBeClearedFromOtherThread) { … }
TEST_F(SweeperTest, SweepOnAllocationTakeLastFreeListEntry) { … }
}
}