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

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

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 88335)
+++ third_party/tcmalloc/chromium/src/malloc_extension.cc (working copy)
@@ -32,7 +32,6 @@
#include <config.h>
#include <assert.h>
-#include <stdio.h>
#include <string.h>
#include <stdio.h>
#if defined HAVE_STDINT_H
@@ -52,6 +51,7 @@
#include "maybe_threads.h"
using STL_NAMESPACE::string;
+using STL_NAMESPACE::vector;
static void DumpAddressMap(string* result) {
*result += "\nMAPPED_LIBRARIES:\n";
@@ -59,9 +59,11 @@
const size_t old_resultlen = result->size();
for (int amap_size = 10240; amap_size < 10000000; amap_size *= 2) {
result->resize(old_resultlen + amap_size);
+ bool wrote_all = false;
const int bytes_written =
- tcmalloc::FillProcSelfMaps(&((*result)[old_resultlen]), amap_size);
- if (bytes_written < amap_size - 1) { // we fit!
+ tcmalloc::FillProcSelfMaps(&((*result)[old_resultlen]), amap_size,
+ &wrote_all);
+ if (wrote_all) { // we fit!
(*result)[old_resultlen + bytes_written] = '\0';
result->resize(old_resultlen + bytes_written);
return;
@@ -99,6 +101,9 @@
#endif /* __GLIBC__ */
}
+// SysAllocator implementation
+SysAllocator::~SysAllocator() {}
+
// Default implementation -- does nothing
MallocExtension::~MallocExtension() { }
bool MallocExtension::VerifyAllMemory() { return true; }
@@ -143,6 +148,14 @@
// Default implementation does nothing
}
+SysAllocator* MallocExtension::GetSystemAllocator() {
+ return NULL;
+}
+
+void MallocExtension::SetSystemAllocator(SysAllocator *a) {
+ // Default implementation does nothing
+}
+
void MallocExtension::ReleaseToSystem(size_t num_bytes) {
// Default implementation does nothing
}
@@ -167,6 +180,11 @@
return 0;
}
+void MallocExtension::GetFreeListSizes(
+ vector<MallocExtension::FreeListInfo>* v) {
+ v->clear();
+}
+
// The current malloc extension object.
static pthread_once_t module_init = PTHREAD_ONCE_INIT;
« no previous file with comments | « third_party/tcmalloc/chromium/src/linux_shadow_stacks.cc ('k') | third_party/tcmalloc/chromium/src/malloc_hook.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698