Index: base/allocator/allocated_type_profiler.h |
diff --git a/base/allocator/allocated_type_profiler.h b/base/allocator/allocated_type_profiler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..37ca7ceea75cc6f891cb031ef8228df24d9ba1ff |
--- /dev/null |
+++ b/base/allocator/allocated_type_profiler.h |
@@ -0,0 +1,29 @@ |
+// 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. |
Ryan Sleevi
2012/08/10 04:16:09
style nit: See chromium-dev thread about new copyr
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Done for all new files.
|
+ |
+#ifndef BASE_ALLOCATOR_ALLOCATED_TYPE_PROFILER_H_ |
+#define BASE_ALLOCATOR_ALLOCATED_TYPE_PROFILER_H_ |
+ |
+// We use __linux__ since this file is included automatically by the compiler |
+// option '-include' before build/build_config.h. |
Ryan Sleevi
2012/08/10 04:16:09
Can you not include build/build_config.h?
Alterna
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Used #if defined(PROFILING_ALLOCATED_TYPE).
|
+#if defined(__linux__) && defined(__clang__) |
+ |
+#include <cstddef> |
+#include <typeinfo> |
+ |
+// These functions are inserted around all 'new' and 'delete' expressions by |
+// the compiler option '-fintercept-allocation-functions' introduced in a |
+// modified version of Clang at http://crrev.com/149572. |
Ryan Sleevi
2012/08/10 04:16:09
nit: This comment can easily get out of date; it's
Dai Mikurube (NOT FULLTIME)
2012/08/10 07:30:03
Ok, but I guess we should have a description that
|
+ |
+void* __op_new_intercept__(void* ptr, |
+ size_t size, |
+ const std::type_info& type); |
+ |
+void* __op_delete_intercept__(void* ptr, |
+ size_t size, |
+ const std::type_info& type); |
+ |
+#endif // defined(__linux__) && defined(__clang__) |
+ |
+#endif // BASE_ALLOCATOR_ALLOCATED_TYPE_PROFILER_H_ |