#include "components/gwp_asan/client/sampling_partitionalloc_shims.h"
#include <algorithm>
#include <utility>
#include "components/crash/core/common/crash_key.h"
#include "components/gwp_asan/client/export.h"
#include "components/gwp_asan/client/guarded_page_allocator.h"
#include "components/gwp_asan/client/sampling_state.h"
#include "components/gwp_asan/common/crash_key_name.h"
#include "partition_alloc/flags.h"
#include "partition_alloc/partition_alloc.h"
namespace gwp_asan {
namespace internal {
namespace {
SamplingState<PARTITIONALLOC> sampling_state;
GuardedPageAllocator* gpa = …;
bool AllocationHook(void** out,
partition_alloc::AllocFlags flags,
size_t size,
const char* type_name) { … }
bool FreeHook(void* address) { … }
bool ReallocHook(size_t* out, void* address) { … }
}
GWP_ASAN_EXPORT GuardedPageAllocator& GetPartitionAllocGpaForTesting() { … }
void InstallPartitionAllocHooks(
const AllocatorSettings& settings,
GuardedPageAllocator::OutOfMemoryCallback callback) { … }
}
}