OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/allocator/allocator_shim.h" | 5 #include "base/allocator/allocator_shim.h" |
6 #include "base/allocator/allocator_shim_internals.h" | 6 #include "base/allocator/allocator_shim_internals.h" |
7 #include "third_party/tcmalloc/chromium/src/config.h" | 7 #include "third_party/tcmalloc/chromium/src/config.h" |
8 #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h" | 8 #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 const AllocatorDispatch AllocatorDispatch::default_dispatch = { | 40 const AllocatorDispatch AllocatorDispatch::default_dispatch = { |
41 &TCMalloc, /* alloc_function */ | 41 &TCMalloc, /* alloc_function */ |
42 &TCCalloc, /* alloc_zero_initialized_function */ | 42 &TCCalloc, /* alloc_zero_initialized_function */ |
43 &TCMemalign, /* alloc_aligned_function */ | 43 &TCMemalign, /* alloc_aligned_function */ |
44 &TCRealloc, /* realloc_function */ | 44 &TCRealloc, /* realloc_function */ |
45 &TCFree, /* free_function */ | 45 &TCFree, /* free_function */ |
46 &TCGetSizeEstimate, /* get_size_estimate_function */ | 46 &TCGetSizeEstimate, /* get_size_estimate_function */ |
| 47 nullptr, /* batch_malloc_function */ |
| 48 nullptr, /* batch_free_function */ |
| 49 nullptr, /* free_definite_size_function */ |
47 nullptr, /* next */ | 50 nullptr, /* next */ |
48 }; | 51 }; |
49 | 52 |
50 // In the case of tcmalloc we have also to route the diagnostic symbols, | 53 // In the case of tcmalloc we have also to route the diagnostic symbols, |
51 // which are not part of the unified shim layer, to tcmalloc for consistency. | 54 // which are not part of the unified shim layer, to tcmalloc for consistency. |
52 | 55 |
53 extern "C" { | 56 extern "C" { |
54 | 57 |
55 SHIM_ALWAYS_EXPORT void malloc_stats(void) __THROW { | 58 SHIM_ALWAYS_EXPORT void malloc_stats(void) __THROW { |
56 return tc_malloc_stats(); | 59 return tc_malloc_stats(); |
(...skipping 15 matching lines...) Expand all Loading... |
72 | 75 |
73 #if defined(__ANDROID__) | 76 #if defined(__ANDROID__) |
74 SHIM_ALWAYS_EXPORT size_t malloc_usable_size(const void* address) __THROW { | 77 SHIM_ALWAYS_EXPORT size_t malloc_usable_size(const void* address) __THROW { |
75 #else | 78 #else |
76 SHIM_ALWAYS_EXPORT size_t malloc_usable_size(void* address) __THROW { | 79 SHIM_ALWAYS_EXPORT size_t malloc_usable_size(void* address) __THROW { |
77 #endif | 80 #endif |
78 return tc_malloc_size(address); | 81 return tc_malloc_size(address); |
79 } | 82 } |
80 | 83 |
81 } // extern "C" | 84 } // extern "C" |
OLD | NEW |