From c128bf5477e44f1b348206bf213410c74b4be3dd Mon Sep 17 00:00:00 2001 From: "mcgrathr@chromium.org" Date: Mon, 7 Nov 2011 22:42:53 +0000 Subject: 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 --- third_party/tcmalloc/chromium/src/system-alloc.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'third_party') 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); -- cgit v1.1