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..0ea7c1f0903338b118d6cb2a36e638f7ec527f34 |
--- /dev/null |
+++ b/third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h |
@@ -0,0 +1,45 @@ |
+// 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 BASE_ALLOCATED_TYPE_MAP_H_ |
Alexander Potapenko
2012/08/03 09:57:07
The include guard should probably have a different
Dai Mikurube (NOT FULLTIME)
2012/08/07 10:39:18
tcmalloc, malloc_hook and stacktrace have a differ
|
+#define BASE_ALLOCATED_TYPE_MAP_H_ |
+ |
+#include <typeinfo> |
+ |
+#ifndef PERFTOOLS_DLL_DECL |
Alexander Potapenko
2012/08/02 14:57:12
Isn't PERFTOOLS_DLL_DECL declared somewhere alread
Dai Mikurube (NOT FULLTIME)
2012/08/02 16:14:35
Ah, right. We may want to remote it. I'll consid
Dai Mikurube (NOT FULLTIME)
2012/08/03 10:01:50
Removed.
|
+# ifdef _WIN32 |
+# define PERFTOOLS_DLL_DECL __declspec(dllimport) |
+# else |
+# define PERFTOOLS_DLL_DECL |
+# endif |
+#endif |
+ |
+#ifdef __cplusplus |
+extern "C" { |
+#endif |
+ |
+struct AllocatedObject { |
Alexander Potapenko
2012/08/03 09:57:07
Use the specified order of declarations within a c
Dai Mikurube (NOT FULLTIME)
2012/08/07 10:39:18
Done: added "public:" and re-ordered constructors
|
+ unsigned int size; |
+ const std::type_info* type; |
+ |
+ AllocatedObject(): size(0), type(NULL) {} |
+ AllocatedObject(unsigned int a, const std::type_info* b): size(a), type(b) {} |
+}; |
+ |
+PERFTOOLS_DLL_DECL void InsertAllocatedType( |
+ void* address, unsigned int size, const std::type_info& type); |
jar (doing other things)
2012/08/02 23:38:30
nit: one arg per line. Indent matching paren.
Dai Mikurube (NOT FULLTIME)
2012/08/03 10:01:50
Done.
|
+ |
+PERFTOOLS_DLL_DECL void EraseAllocatedType(void* address); |
+ |
+PERFTOOLS_DLL_DECL const std::type_info* LookupAllocatedType( |
+ const void* address); |
+ |
+PERFTOOLS_DLL_DECL void IterateAllocatedType( |
+ void (*callback)(const void*, AllocatedObject*, void*), void* arg); |
+ |
+#ifdef __cplusplus |
+} // extern "C" |
+#endif |
+ |
+#endif /* BASE_ALLOCATED_TYPE_MAP_H_ */ |