OLD | NEW |
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 <stddef.h> |
7 #include <stdlib.h> | 8 #include <stdlib.h> |
8 | 9 |
9 namespace base { | 10 namespace base { |
10 | 11 |
11 void EnableTerminationOnOutOfMemory() { | 12 void EnableTerminationOnOutOfMemory() { |
12 } | 13 } |
13 | 14 |
14 void EnableTerminationOnHeapCorruption() { | 15 void EnableTerminationOnHeapCorruption() { |
15 } | 16 } |
16 | 17 |
(...skipping 13 matching lines...) Expand all Loading... |
30 *result = malloc(size); | 31 *result = malloc(size); |
31 return *result != nullptr; | 32 return *result != nullptr; |
32 } | 33 } |
33 | 34 |
34 bool UncheckedCalloc(size_t num_items, size_t size, void** result) { | 35 bool UncheckedCalloc(size_t num_items, size_t size, void** result) { |
35 *result = calloc(num_items, size); | 36 *result = calloc(num_items, size); |
36 return *result != nullptr; | 37 return *result != nullptr; |
37 } | 38 } |
38 | 39 |
39 } // namespace base | 40 } // namespace base |
OLD | NEW |