Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: base/allocator/type_profiler.h

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflected the comments. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698