Chromium Code Reviews| 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..b2ca549543729d4dc4daabd3bc1e0f3b0b89c4cb |
| --- /dev/null |
| +++ b/third_party/tcmalloc/chromium/src/gperftools/allocated_type_map.h |
| @@ -0,0 +1,37 @@ |
| +// 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/07 11:56:56
Is this "BASE"? Sorry, I don't know how it's calle
Dai Mikurube (NOT FULLTIME)
2012/08/08 06:16:23
E.g. heap-checker is not in base/BASE, but it uses
|
| +#define BASE_ALLOCATED_TYPE_MAP_H_ |
| + |
| +#include <typeinfo> |
| + |
| +// We don't use PERFTOOLS_DLL_DECL since AllocatedTypeMap works only on Linux. |
| + |
| +#ifdef __cplusplus |
| +extern "C" { |
| +#endif |
| + |
| +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); |
| + |
| +#ifdef __cplusplus |
| +} // extern "C" |
| +#endif |
| + |
| +#endif /* BASE_ALLOCATED_TYPE_MAP_H_ */ |