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

Unified Diff: third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h

Issue 10411047: Type profiler by intercepting 'new' and 'delete' expressions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflected comments #21,22 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: third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h
diff --git a/third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h b/third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h
new file mode 100644
index 0000000000000000000000000000000000000000..39565db5429b962e1ed6a44b4ba341af74dad736
--- /dev/null
+++ b/third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.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.
+
+#ifndef ALLOCATED_TYPE_MAP_H_
+#define ALLOCATED_TYPE_MAP_H_
+
+#include <typeinfo>
+
+// We don't use PERFTOOLS_DLL_DECL since AllocatedTypeMap works only on Linux.
+
+struct AllocatedObject {
+ public:
+ AllocatedObject(): size(0), type(NULL) {}
+ AllocatedObject(unsigned int a, const std::type_info* b): size(a), type(b) {}
+
+ unsigned int size;
+ const std::type_info* type;
+};
+
+void InsertAllocatedType(void* address,
+ unsigned int size,
+ const std::type_info& type);
+
+void EraseAllocatedType(void* address);
+
+const std::type_info* LookupAllocatedType(const void* address);
+
+#endif /* ALLOCATED_TYPE_MAP_H_ */
Ryan Sleevi 2012/08/10 04:16:09 nit: Mixing comment styles between C++ (//) and C
Dai Mikurube (NOT FULLTIME) 2012/08/10 07:30:03 Good catch. Thanks. (It might come from heap-pro

Powered by Google App Engine
This is Rietveld 408576698