| Index: third_party/tcmalloc/chromium/src/malloc_extension.cc
|
| ===================================================================
|
| --- third_party/tcmalloc/chromium/src/malloc_extension.cc (revision 126022)
|
| +++ third_party/tcmalloc/chromium/src/malloc_extension.cc (working copy)
|
| @@ -45,10 +45,9 @@
|
| #include "base/dynamic_annotations.h"
|
| #include "base/sysinfo.h" // for FillProcSelfMaps
|
| #ifndef NO_HEAP_CHECK
|
| -#include "gperftools/heap-checker.h"
|
| +#include "google/heap-checker.h"
|
| #endif
|
| -#include "gperftools/malloc_extension.h"
|
| -#include "gperftools/malloc_extension_c.h"
|
| +#include "google/malloc_extension.h"
|
| #include "maybe_threads.h"
|
|
|
| using STL_NAMESPACE::string;
|
| @@ -108,9 +107,9 @@
|
| // Default implementation -- does nothing
|
| MallocExtension::~MallocExtension() { }
|
| bool MallocExtension::VerifyAllMemory() { return true; }
|
| -bool MallocExtension::VerifyNewMemory(const void* p) { return true; }
|
| -bool MallocExtension::VerifyArrayNewMemory(const void* p) { return true; }
|
| -bool MallocExtension::VerifyMallocMemory(const void* p) { return true; }
|
| +bool MallocExtension::VerifyNewMemory(void* p) { return true; }
|
| +bool MallocExtension::VerifyArrayNewMemory(void* p) { return true; }
|
| +bool MallocExtension::VerifyMallocMemory(void* p) { return true; }
|
|
|
| bool MallocExtension::GetNumericProperty(const char* property, size_t* value) {
|
| return false;
|
| @@ -177,15 +176,10 @@
|
| return size;
|
| }
|
|
|
| -size_t MallocExtension::GetAllocatedSize(const void* p) {
|
| - assert(GetOwnership(p) != kNotOwned);
|
| +size_t MallocExtension::GetAllocatedSize(void* p) {
|
| return 0;
|
| }
|
|
|
| -MallocExtension::Ownership MallocExtension::GetOwnership(const void* p) {
|
| - return kUnknownOwnership;
|
| -}
|
| -
|
| void MallocExtension::GetFreeListSizes(
|
| vector<MallocExtension::FreeListInfo>* v) {
|
| v->clear();
|
| @@ -244,11 +238,11 @@
|
| uintptr_t count, uintptr_t size) {
|
| char buf[100];
|
| snprintf(buf, sizeof(buf),
|
| - "%6"PRIu64": %8"PRIu64" [%6"PRIu64": %8"PRIu64"] @",
|
| - static_cast<uint64>(count),
|
| - static_cast<uint64>(size),
|
| - static_cast<uint64>(count),
|
| - static_cast<uint64>(size));
|
| + "%6lld: %8lld [%6lld: %8lld] @",
|
| + static_cast<long long>(count),
|
| + static_cast<long long>(size),
|
| + static_cast<long long>(count),
|
| + static_cast<long long>(size));
|
| writer->append(buf, strlen(buf));
|
| }
|
|
|
| @@ -343,9 +337,9 @@
|
| }
|
|
|
| C_SHIM(VerifyAllMemory, int, (void), ());
|
| -C_SHIM(VerifyNewMemory, int, (const void* p), (p));
|
| -C_SHIM(VerifyArrayNewMemory, int, (const void* p), (p));
|
| -C_SHIM(VerifyMallocMemory, int, (const void* p), (p));
|
| +C_SHIM(VerifyNewMemory, int, (void* p), (p));
|
| +C_SHIM(VerifyArrayNewMemory, int, (void* p), (p));
|
| +C_SHIM(VerifyMallocMemory, int, (void* p), (p));
|
| C_SHIM(MallocMemoryStats, int,
|
| (int* blocks, size_t* total, int histogram[kMallocHistogramSize]),
|
| (blocks, total, histogram));
|
| @@ -362,11 +356,4 @@
|
| C_SHIM(ReleaseFreeMemory, void, (void), ());
|
| C_SHIM(ReleaseToSystem, void, (size_t num_bytes), (num_bytes));
|
| C_SHIM(GetEstimatedAllocatedSize, size_t, (size_t size), (size));
|
| -C_SHIM(GetAllocatedSize, size_t, (const 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));
|
| -}
|
| +C_SHIM(GetAllocatedSize, size_t, (void* p), (p));
|
|
|