#include <stddef.h>
#include <stdlib.h>
#include <algorithm>
#include <tuple>
#include "base/debug/alias.h"
#include "base/process/memory.h"
#include "build/build_config.h"
#include "third_party/skia/include/core/SkTypes.h"
#include "third_party/skia/include/private/base/SkMalloc.h"
#if BUILDFLAG(IS_WIN)
#include <malloc.h>
#include <windows.h>
#elif BUILDFLAG(IS_APPLE)
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
static inline void* throw_on_failure(size_t size, void* p) { … }
void sk_abort_no_print() { … }
void sk_out_of_memory(void) { … }
void* sk_realloc_throw(void* addr, size_t size) { … }
void sk_free(void* p) { … }
static void* prevent_overcommit(int fill, size_t size, void* p) { … }
static void* malloc_nothrow(size_t size, int debug_sentinel) { … }
static void* malloc_throw(size_t size, int debug_sentinel) { … }
static void* calloc_nothrow(size_t size) { … }
static void* calloc_throw(size_t size) { … }
void* sk_malloc_flags(size_t size, unsigned flags) { … }
size_t sk_malloc_size(void* addr, size_t size) { … }