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..ea8ec878ff55eb879f0c85420d32980f2d34201e |
--- /dev/null |
+++ b/base/allocator/allocated_type_profiler_control.cc |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 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 "allocated_type_profiler_control.h" |
+ |
+#ifdef PROFILING_ALLOCATED_TYPE |
Ryan Sleevi
2012/08/10 04:16:09
style nit: In general, Chromium code tends more to
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Done.
|
+ |
+static int g_enable_intercept = 1; |
+ |
+namespace base { |
+namespace allocated_type { |
+ |
+// Stops the interceptors __op_new_intercept__ and __op_delete_intercept__. |
+// |
+// The interceptors should be stopped at new/delete between fork and exec. |
+// See http://crbug.com/36678. |
+ |
+void StopProfilingAllocatedType() { |
+ g_enable_intercept = 0; |
+} |
+ |
+bool IsProfilingAllocatedType() { |
+ return g_enable_intercept != 0; |
+} |
+ |
+} |
+} |
+ |
+#else // PROFILING_ALLOCATED_TYPE |
Ryan Sleevi
2012/08/10 04:16:09
nit: Having a broad swath of file between #ifdefs
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Done.
|
+ |
+namespace base { |
+namespace allocated_type { |
+ |
+void StopProfilingAllocatedType() { |
+ // no operation |
+} |
+ |
+bool IsProfilingAllocatedType() { |
+ return true; |
Ryan Sleevi
2012/08/10 04:16:09
Is this really true?
Seems like you should be ret
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Thanks for the good catch. Right. It affects nothi
|
+} |
+ |
+} |
+} |
+ |
+#endif // PROFILING_ALLOCATED_TYPE |