Index: third_party/tcmalloc/chromium/src/malloc_extension.cc |
=================================================================== |
--- third_party/tcmalloc/chromium/src/malloc_extension.cc (revision 94429) |
+++ third_party/tcmalloc/chromium/src/malloc_extension.cc (working copy) |
@@ -48,6 +48,7 @@ |
#include "google/heap-checker.h" |
#endif |
#include "google/malloc_extension.h" |
+#include "google/malloc_extension_c.h" |
#include "maybe_threads.h" |
using STL_NAMESPACE::string; |
@@ -177,9 +178,14 @@ |
} |
size_t MallocExtension::GetAllocatedSize(void* p) { |
+ assert(GetOwnership(p) != kNotOwned); |
return 0; |
} |
+MallocExtension::Ownership MallocExtension::GetOwnership(const void* p) { |
+ return kUnknownOwnership; |
+} |
+ |
void MallocExtension::GetFreeListSizes( |
vector<MallocExtension::FreeListInfo>* v) { |
v->clear(); |
@@ -238,11 +244,11 @@ |
uintptr_t count, uintptr_t size) { |
char buf[100]; |
snprintf(buf, sizeof(buf), |
- "%6lld: %8lld [%6lld: %8lld] @", |
- static_cast<long long>(count), |
- static_cast<long long>(size), |
- static_cast<long long>(count), |
- static_cast<long long>(size)); |
+ "%6"PRIu64": %8"PRIu64" [%6"PRIu64": %8"PRIu64"] @", |
+ static_cast<uint64>(count), |
+ static_cast<uint64>(size), |
+ static_cast<uint64>(count), |
+ static_cast<uint64>(size)); |
writer->append(buf, strlen(buf)); |
} |
@@ -357,3 +363,10 @@ |
C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes)); |
C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size)); |
C_SHIM(GetAllocatedSize, size_t, (void* p), (p)); |
+ |
+// Can't use the shim here because of the need to translate the enums. |
+extern "C" |
+MallocExtension_Ownership MallocExtension_GetOwnership(const void* p) { |
+ return static_cast<MallocExtension_Ownership>( |
+ MallocExtension::instance()->GetOwnership(p)); |
+} |