blob: 5b8cd13cc121e55a9f257f142d6f579a881ffdbb [file] [log] [blame]
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/process/memory.h"
#include "base/allocator/allocator_interception_mac.h"
#include "base/allocator/allocator_shim.h"
#include "base/allocator/buildflags.h"
#include "build/build_config.h"
namespace base {
namespace {
void oom_killer_new() {
} // namespace
void EnableTerminationOnHeapCorruption() {
DLOG(WARNING) << "EnableTerminationOnHeapCorruption only works on 64-bit";
bool UncheckedMalloc(size_t size, void** result) {
return allocator::UncheckedMallocMac(size, result);
bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
return allocator::UncheckedCallocMac(num_items, size, result);
void EnableTerminationOnOutOfMemory() {
// Step 1: Enable OOM killer on C++ failures.
// Step 2: Enable OOM killer on C-malloc failures for the default zone (if we
// have a shim).
// Step 3: Enable OOM killer on all other malloc zones (or just "all" without
// "other" if shim is disabled).
} // namespace base