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

Unified Diff: third_party/tcmalloc/chromium/src/malloc_extension.cc

Issue 7430007: Merge tcmalloc r111 (perftools v. 1.8) with the chromium/ branch. Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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/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));
+}

Powered by Google App Engine
This is Rietveld 408576698