#include "include/cppgc/allocation.h"
#include "include/cppgc/default-platform.h"
#include "include/cppgc/member.h"
#include "include/cppgc/persistent.h"
#include "src/heap/cppgc/globals.h"
#include "src/heap/cppgc/marker.h"
#include "src/heap/cppgc/marking-visitor.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 {
class ConcurrentMarkingTest : public testing::TestWithHeap { … };
template <typename T>
struct GCedHolder : public GarbageCollected<GCedHolder<T>> { … };
class GCed : public GarbageCollected<GCed> { … };
class GCedWithCallback : public GarbageCollected<GCedWithCallback> { … };
class Mixin : public GarbageCollectedMixin { … };
class GCedWithMixin : public GarbageCollected<GCedWithMixin>, public Mixin { … };
}
TEST_F(ConcurrentMarkingTest, MarkingObjects) { … }
TEST_F(ConcurrentMarkingTest, MarkingInConstructionObjects) { … }
TEST_F(ConcurrentMarkingTest, MarkingMixinObjects) { … }
namespace {
struct ConcurrentlyTraceable : public GarbageCollected<ConcurrentlyTraceable> { … };
size_t ConcurrentlyTraceable::trace_counter = …;
struct NotConcurrentlyTraceable
: public GarbageCollected<NotConcurrentlyTraceable> { … };
size_t NotConcurrentlyTraceable::trace_counter = …;
}
TEST_F(ConcurrentMarkingTest, ConcurrentlyTraceableObjectIsTracedConcurrently) { … }
TEST_F(ConcurrentMarkingTest,
NotConcurrentlyTraceableObjectIsNotTracedConcurrently) { … }
}
}