#include "base/process/memory.h"
#include <stddef.h>
#include <new>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/process/internal_linux.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/shim/allocator_shim.h"
#if !PA_BUILDFLAG(USE_ALLOCATOR_SHIM) && \
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR) && defined(LIBC_GLIBC)
extern "C" {
void* __libc_malloc(size_t);
void __libc_free(void*);
}
#endif
namespace base {
namespace {
void ReleaseReservationOrTerminate() { … }
}
void EnableTerminationOnHeapCorruption() { … }
void EnableTerminationOnOutOfMemory() { … }
class AdjustOOMScoreHelper { … };
bool AdjustOOMScoreHelper::AdjustOOMScore(ProcessId process, int score) { … }
bool AdjustOOMScore(ProcessId process, int score) { … }
bool UncheckedMalloc(size_t size, void** result) { … }
void UncheckedFree(void* ptr) { … }
}