#include "third_party/blink/renderer/platform/wtf/allocator/partitions.h"
#include "base/allocator/partition_alloc_features.h"
#include "base/allocator/partition_alloc_support.h"
#include "base/debug/alias.h"
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "base/strings/safe_sprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/thread_annotations.h"
#include "build/build_config.h"
#include "components/crash/core/common/crash_key.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/oom.h"
#include "partition_alloc/page_allocator.h"
#include "partition_alloc/partition_alloc.h"
#include "partition_alloc/partition_alloc_constants.h"
#include "partition_alloc/partition_root.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
namespace WTF {
const char* const Partitions::kAllocatedObjectPoolName = …;
BASE_FEATURE(…);
#endif
bool Partitions::initialized_ = …;
partition_alloc::PartitionRoot* Partitions::fast_malloc_root_ = …;
partition_alloc::PartitionRoot* Partitions::array_buffer_root_ = …;
partition_alloc::PartitionRoot* Partitions::buffer_root_ = …;
namespace {
partition_alloc::PartitionOptions PartitionOptionsFromFeatures() { … }
}
void Partitions::Initialize() { … }
bool Partitions::InitializeOnce() { … }
void Partitions::InitializeArrayBufferPartition() { … }
void Partitions::StartMemoryReclaimer(
scoped_refptr<base::SequencedTaskRunner> task_runner) { … }
void Partitions::DumpMemoryStats(
bool is_light_dump,
partition_alloc::PartitionStatsDumper* partition_stats_dumper) { … }
namespace {
class LightPartitionStatsDumperImpl
: public partition_alloc::PartitionStatsDumper { … };
}
size_t Partitions::TotalSizeOfCommittedPages() { … }
size_t Partitions::TotalActiveBytes() { … }
NOINLINE static void PartitionsOutOfMemoryUsing2G(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing1G(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing512M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing256M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing128M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing64M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing32M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsing16M(size_t size) { … }
NOINLINE static void PartitionsOutOfMemoryUsingLessThan16M(size_t size) { … }
void* Partitions::BufferMalloc(size_t n, const char* type_name) { … }
void* Partitions::BufferTryRealloc(void* p, size_t n, const char* type_name) { … }
void Partitions::BufferFree(void* p) { … }
size_t Partitions::BufferPotentialCapacity(size_t n) { … }
void* Partitions::FastMalloc(size_t n, const char* type_name) { … }
void* Partitions::FastZeroedMalloc(size_t n, const char* type_name) { … }
void Partitions::FastFree(void* p) { … }
void Partitions::HandleOutOfMemory(size_t size) { … }
void Partitions::AdjustPartitionsForForeground() { … }
void Partitions::AdjustPartitionsForBackground() { … }
}