#include "base/memory/safety_checks.h"
#include <new>
#include "base/allocator/partition_alloc_features.h"
#include "base/feature_list.h"
#include "partition_alloc/partition_address_space.h"
#include "partition_alloc/tagging.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
is_memory_safety_checked;
MemorySafetyCheck;
struct DefaultChecks { … };
struct AdvancedChecks { … };
struct AnotherAdvancedChecks { … };
constexpr int kLargeAlignment = …;
struct alignas(kLargeAlignment) AlignedAdvancedChecks { … };
struct PrivateInheritanceWithInheritMacro : private AdvancedChecks { … };
static_assert …;
struct PrivateInheritanceWithDefaultMacro : private AdvancedChecks { … };
static_assert …;
struct MultipleInheritanceWithInheritMacro : AdvancedChecks,
AnotherAdvancedChecks { … };
static_assert …;
struct MultipleInheritanceWithDefaultMacro : AdvancedChecks,
AnotherAdvancedChecks { … };
static_assert …;
struct AdvancedChecksWithPartialOverwrite { … };
static_assert …;
struct InheritanceWithPartialOverwrite : private AdvancedChecks { … };
static_assert …;
TEST(MemorySafetyCheckTest, AllocatorFunctions) { … }
#if PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
TEST(MemorySafetyCheckTest, SchedulerLoopQuarantine) { … }
TEST(MemorySafetyCheckTest, ZapOnFree) { … }
#endif
}