summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormcgrathr@chromium.org <mcgrathr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 22:42:53 +0000
committermcgrathr@chromium.org <mcgrathr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-07 22:42:53 +0000
commitc128bf5477e44f1b348206bf213410c74b4be3dd (patch)
treeb807d73f00bf5e9799a3c75c4f3b957dbbd639cd
parent407fb291a42f4f21a63b3d4e34eb6583d4a5979e (diff)
downloadchromium_src-c128bf5477e44f1b348206bf213410c74b4be3dd.zip
chromium_src-c128bf5477e44f1b348206bf213410c74b4be3dd.tar.gz
chromium_src-c128bf5477e44f1b348206bf213410c74b4be3dd.tar.bz2
tcmalloc: Initialize DefaultSysAllocator::names_
When DefaultSysAllocator::Alloc fails, it prints a message. This message passes NULL to a printf-like function, so it prints "(null)" in the message. It was clearly intended to print "SbrkSysAllocator" or "MmapSysAllocator" in that place. BUG= none TEST= none R=glider@chromium.org,sehr@google.com,bradchen@google.com Review URL: http://codereview.chromium.org/8474003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108927 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--third_party/tcmalloc/chromium/src/system-alloc.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/third_party/tcmalloc/chromium/src/system-alloc.cc b/third_party/tcmalloc/chromium/src/system-alloc.cc
index 5053981..f5aa0a0 100644
--- a/third_party/tcmalloc/chromium/src/system-alloc.cc
+++ b/third_party/tcmalloc/chromium/src/system-alloc.cc
@@ -160,6 +160,7 @@ class DefaultSysAllocator : public SysAllocator {
for (int i = 0; i < kMaxAllocators; i++) {
failed_[i] = true;
allocs_[i] = NULL;
+ names_[i] = NULL;
}
}
void SetChildAllocator(SysAllocator* alloc, unsigned int index,
@@ -167,6 +168,7 @@ class DefaultSysAllocator : public SysAllocator {
if (index < kMaxAllocators && alloc != NULL) {
allocs_[index] = alloc;
failed_[index] = false;
+ names_[index] = name;
}
}
void* Alloc(size_t size, size_t *actual_size, size_t alignment);