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

Unified Diff: base/allocator/allocated_type_profiler_control.cc

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflected Jim's comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/allocator/allocated_type_profiler_control.cc
diff --git a/base/allocator/allocated_type_profiler_control.cc b/base/allocator/allocated_type_profiler_control.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ebc6d79952b85423f0997401ed8dd6d1d99c219a
--- /dev/null
+++ b/base/allocator/allocated_type_profiler_control.cc
@@ -0,0 +1,29 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/allocator/allocated_type_profiler_control.h"
+
+#if defined(PROFILING_ALLOCATED_TYPE)
+static int g_enable_intercept = 1;
+#endif
+
+namespace base {
+namespace allocated_type_profiler {
+
+void StopProfilingAllocatedType() {
+#if defined(PROFILING_ALLOCATED_TYPE)
+ g_enable_intercept = 0;
+#endif
+}
+
+bool IsProfilingAllocatedType() {
+#if defined(PROFILING_ALLOCATED_TYPE)
+ return g_enable_intercept != 0;
+#else
+ return false;
+#endif
+}
+
+} // namespace allocated_type_profiler
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698