| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/debug/alias.h" | 5 #include "base/debug/alias.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/process/memory.h" | 7 #include "base/process/memory.h" |
| 8 #include "build/build_config.h" |
| 8 | 9 |
| 9 namespace base { | 10 namespace base { |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 // Breakpad server classifies base::`anonymous namespace'::OnNoMemory as | 14 // Breakpad server classifies base::`anonymous namespace'::OnNoMemory as |
| 14 // out-of-memory crash. | 15 // out-of-memory crash. |
| 15 NOINLINE void OnNoMemory(size_t size) { | 16 NOINLINE void OnNoMemory(size_t size) { |
| 16 size_t tmp_size = size; | 17 size_t tmp_size = size; |
| 17 base::debug::Alias(&tmp_size); | 18 base::debug::Alias(&tmp_size); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 39 if (!UncheckedMalloc(alloc_size, result)) | 40 if (!UncheckedMalloc(alloc_size, result)) |
| 40 return false; | 41 return false; |
| 41 | 42 |
| 42 memset(*result, 0, alloc_size); | 43 memset(*result, 0, alloc_size); |
| 43 return true; | 44 return true; |
| 44 } | 45 } |
| 45 | 46 |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 } // namespace base | 49 } // namespace base |
| OLD | NEW |