#include "src/heap/cppgc/compactor.h"
#include "include/cppgc/allocation.h"
#include "include/cppgc/custom-space.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/garbage-collector.h"
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-page.h"
#include "src/heap/cppgc/marker.h"
#include "src/heap/cppgc/stats-collector.h"
#include "test/unittests/heap/cppgc/tests.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cppgc {
class CompactableCustomSpace : public CustomSpace<CompactableCustomSpace> { … };
namespace internal {
namespace {
struct CompactableGCed : public GarbageCollected<CompactableGCed> { … };
size_t CompactableGCed::g_destructor_callcount = …;
template <int kNumObjects>
struct CompactableHolder
: public GarbageCollected<CompactableHolder<kNumObjects>> { … };
class CompactorTest : public testing::TestWithPlatform { … };
}
}
template <>
struct SpaceTrait<internal::CompactableGCed> { … };
namespace internal {
TEST_F(CompactorTest, NothingToCompact) { … }
TEST_F(CompactorTest, NonEmptySpaceAllLive) { … }
TEST_F(CompactorTest, NonEmptySpaceAllDead) { … }
TEST_F(CompactorTest, NonEmptySpaceHalfLive) { … }
TEST_F(CompactorTest, CompactAcrossPages) { … }
TEST_F(CompactorTest, InteriorSlotToPreviousObject) { … }
TEST_F(CompactorTest, InteriorSlotToNextObject) { … }
TEST_F(CompactorTest, OnStackSlotShouldBeFiltered) { … }
}
}