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 <new> | 7 #include <new> |
8 | 8 |
9 #include "base/file_util.h" | |
10 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/process/internal_linux.h" | 12 #include "base/process/internal_linux.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 | 14 |
15 #if defined(USE_TCMALLOC) | 15 #if defined(USE_TCMALLOC) |
16 // Used by UncheckedMalloc. If tcmalloc is linked to the executable | 16 // Used by UncheckedMalloc. If tcmalloc is linked to the executable |
17 // this will be replaced by a strong symbol that actually implement | 17 // this will be replaced by a strong symbol that actually implement |
18 // the semantics and don't call new handler in case the allocation fails. | 18 // the semantics and don't call new handler in case the allocation fails. |
19 extern "C" { | 19 extern "C" { |
20 | 20 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 *result = malloc(size); | 204 *result = malloc(size); |
205 #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) | 205 #elif defined(LIBC_GLIBC) && !defined(USE_TCMALLOC) |
206 *result = __libc_malloc(size); | 206 *result = __libc_malloc(size); |
207 #elif defined(USE_TCMALLOC) | 207 #elif defined(USE_TCMALLOC) |
208 *result = tc_malloc_skip_new_handler_weak(size); | 208 *result = tc_malloc_skip_new_handler_weak(size); |
209 #endif | 209 #endif |
210 return *result != NULL; | 210 return *result != NULL; |
211 } | 211 } |
212 | 212 |
213 } // namespace base | 213 } // namespace base |
OLD | NEW |