Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: base/process/memory_mac.mm

Issue 2902043007: allocator: rename use_experimental_allocator_shim to use_allocator_shim (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/process/memory_linux.cc ('k') | base/process/memory_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process/memory.h" 5 #include "base/process/memory.h"
6 6
7 #include "base/allocator/allocator_interception_mac.h" 7 #include "base/allocator/allocator_interception_mac.h"
8 #include "base/allocator/allocator_shim.h" 8 #include "base/allocator/allocator_shim.h"
9 #include "base/allocator/features.h" 9 #include "base/allocator/features.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 19 matching lines...) Expand all
30 bool UncheckedCalloc(size_t num_items, size_t size, void** result) { 30 bool UncheckedCalloc(size_t num_items, size_t size, void** result) {
31 return allocator::UncheckedCallocMac(num_items, size, result); 31 return allocator::UncheckedCallocMac(num_items, size, result);
32 } 32 }
33 33
34 void EnableTerminationOnOutOfMemory() { 34 void EnableTerminationOnOutOfMemory() {
35 // Step 1: Enable OOM killer on C++ failures. 35 // Step 1: Enable OOM killer on C++ failures.
36 std::set_new_handler(oom_killer_new); 36 std::set_new_handler(oom_killer_new);
37 37
38 // Step 2: Enable OOM killer on C-malloc failures for the default zone (if we 38 // Step 2: Enable OOM killer on C-malloc failures for the default zone (if we
39 // have a shim). 39 // have a shim).
40 #if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) 40 #if BUILDFLAG(USE_ALLOCATOR_SHIM)
41 allocator::SetCallNewHandlerOnMallocFailure(true); 41 allocator::SetCallNewHandlerOnMallocFailure(true);
42 #endif 42 #endif
43 43
44 // Step 3: Enable OOM killer on all other malloc zones (or just "all" without 44 // Step 3: Enable OOM killer on all other malloc zones (or just "all" without
45 // "other" if shim is disabled). 45 // "other" if shim is disabled).
46 allocator::InterceptAllocationsMac(); 46 allocator::InterceptAllocationsMac();
47 } 47 }
48 48
49 } // namespace base 49 } // namespace base
OLDNEW
« no previous file with comments | « base/process/memory_linux.cc ('k') | base/process/memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698