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

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

Issue 1331973002: Remove clang type profiler and deep memory profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 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
« no previous file with comments | « base/allocator/type_profiler.h ('k') | base/allocator/type_profiler_control.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(TYPE_PROFILING)
6
7 #include "base/allocator/type_profiler.h"
8
9 #include <assert.h>
10
11 namespace {
12
13 void* NopIntercept(void* ptr, size_t size, const std::type_info& type) {
14 return ptr;
15 }
16
17 base::type_profiler::InterceptFunction* g_new_intercept = NopIntercept;
18 base::type_profiler::InterceptFunction* g_delete_intercept = NopIntercept;
19
20 }
21
22 void* __op_new_intercept__(void* ptr,
23 size_t size,
24 const std::type_info& type) {
25 return g_new_intercept(ptr, size, type);
26 }
27
28 void* __op_delete_intercept__(void* ptr,
29 size_t size,
30 const std::type_info& type) {
31 return g_delete_intercept(ptr, size, type);
32 }
33
34 namespace base {
35 namespace type_profiler {
36
37 // static
38 void InterceptFunctions::SetFunctions(InterceptFunction* new_intercept,
39 InterceptFunction* delete_intercept) {
40 // Don't use DCHECK, as this file is injected into targets
41 // that do not and should not depend on base/base.gyp:base
42 assert(g_new_intercept == NopIntercept);
43 assert(g_delete_intercept == NopIntercept);
44
45 g_new_intercept = new_intercept;
46 g_delete_intercept = delete_intercept;
47 }
48
49 // static
50 void InterceptFunctions::ResetFunctions() {
51 g_new_intercept = NopIntercept;
52 g_delete_intercept = NopIntercept;
53 }
54
55 // static
56 bool InterceptFunctions::IsAvailable() {
57 return g_new_intercept != NopIntercept || g_delete_intercept != NopIntercept;
58 }
59
60 } // namespace type_profiler
61 } // namespace base
62
63 #endif // defined(TYPE_PROFILING)
OLDNEW
« no previous file with comments | « base/allocator/type_profiler.h ('k') | base/allocator/type_profiler_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698