#include "core/fxcrt/fx_memory.h"
#include "core/fxcrt/compiler_specific.h"
#include "core/fxcrt/fx_safe_types.h"
#if defined(PDF_USE_PARTITION_ALLOC)
#include "partition_alloc/partition_alloc.h"
#else
#error "File compiled under wrong build option."
#endif
namespace {
constexpr partition_alloc::PartitionOptions kOptions = …;
struct Allocators { … };
Allocators* g_allocators = …;
#ifndef V8_ENABLE_SANDBOX
partition_alloc::PartitionAllocator& GetArrayBufferPartitionAllocator() { … }
#endif
partition_alloc::PartitionAllocator& GetGeneralPartitionAllocator() { … }
partition_alloc::PartitionAllocator& GetStringPartitionAllocator() { … }
}
namespace pdfium::internal {
void* Alloc(size_t num_members, size_t member_size) { … }
void* Calloc(size_t num_members, size_t member_size) { … }
void* Realloc(void* ptr, size_t num_members, size_t member_size) { … }
void Dealloc(void* ptr) { … }
void* StringAlloc(size_t num_members, size_t member_size) { … }
void StringDealloc(void* ptr) { … }
}
void FX_InitializeMemoryAllocators() { … }
void FX_DestroyMemoryAllocators() { … }
#ifndef V8_ENABLE_SANDBOX
void* FX_ArrayBufferAllocate(size_t length) { … }
void* FX_ArrayBufferAllocateUninitialized(size_t length) { … }
void FX_ArrayBufferFree(void* data) { … }
#endif