OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_ALLOCATOR_TYPE_PROFILER_H_ |
| 6 #define BASE_ALLOCATOR_TYPE_PROFILER_H_ |
| 7 |
| 8 #if defined(TYPE_PROFILING) |
| 9 |
| 10 #include <cstddef> |
| 11 #include <typeinfo> |
| 12 |
| 13 namespace base { |
| 14 namespace type_profiler { |
| 15 |
| 16 typedef void* InterceptFunction(void*, size_t, const std::type_info&); |
| 17 |
| 18 void SetInterceptFunctions(InterceptFunction* new_intercept, |
| 19 InterceptFunction* delete_intercept); |
| 20 bool IsInterceptFunctionsAvailable(); |
| 21 |
| 22 } // namespace type_profiler |
| 23 } // namespace base |
| 24 |
| 25 // These functions wrap all 'new' and 'delete' expressions. |
| 26 // They are called by a modified version of Clang checked-in |
| 27 // at deps/third_party/llvm-allocated-type. |
| 28 |
| 29 void* __op_new_intercept__(void* ptr, |
| 30 size_t size, |
| 31 const std::type_info& type); |
| 32 |
| 33 void* __op_delete_intercept__(void* ptr, |
| 34 size_t size, |
| 35 const std::type_info& type); |
| 36 |
| 37 #endif // defined(TYPE_PROFILING) |
| 38 |
| 39 #endif // BASE_ALLOCATOR_TYPE_PROFILER_H_ |
OLD | NEW |