diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 00:30:02 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-24 00:30:02 +0000 |
commit | 03baa08e42c7f4dd4f84ee573fa4fc7aa1281965 (patch) | |
tree | 07495d72116cb60b053f0a5da2b739d6e3f52803 | |
parent | 5815d4cbab80b2b1291e64eda3d12e5975fff939 (diff) | |
download | chromium_src-03baa08e42c7f4dd4f84ee573fa4fc7aa1281965.zip chromium_src-03baa08e42c7f4dd4f84ee573fa4fc7aa1281965.tar.gz chromium_src-03baa08e42c7f4dd4f84ee573fa4fc7aa1281965.tar.bz2 |
Switch to using WinHeap for the browser process
Disabled the TCMalloc double-free detection,
which should restore much of the performance loss
caused by this experiment (to find double frees,
if any). This should resolve bug 76640
As an alternate experiment to better illuminate our
memory corruption problem, this CL also enables
WinHeap (default Windows allocator) in the browser
process. There is a chance that this will cause a
very tiny reduction in performance, but it will surely
increase our crash rate (based on what we saw recently
on the dev channel).
BUG=76640
r=rtenneti
Review URL: http://codereview.chromium.org/6705027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79224 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/allocator/allocator_shim.cc | 4 | ||||
-rw-r--r-- | third_party/tcmalloc/chromium/src/tcmalloc.cc | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index 0bee3d3..97946e7 100644 --- a/base/allocator/allocator_shim.cc +++ b/base/allocator/allocator_shim.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,7 +41,7 @@ typedef enum { // See SetupSubprocessAllocator() to specify a default secondary (subprocess) // allocator. // TODO(jar): Switch to using TCMALLOC for the renderer as well. -static Allocator allocator = TCMALLOC; +static Allocator allocator = WINHEAP; // The names of the environment variables that can optionally control the // selection of the allocator. The primary may be used to control overall diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc index f6bb50c..e702256 100644 --- a/third_party/tcmalloc/chromium/src/tcmalloc.cc +++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc @@ -1611,11 +1611,15 @@ void *(*__memalign_hook)(size_t, size_t, const void *) = MemalignOverride; // to be hashed encoding of the location, so that they can't be copied over a // different region (by accident) without being detected (most of the time). -#define TCMALLOC_VALIDATION +// Uncomment the following define to turn on all the TCMalloc checking. +// It will cost abotu 2% in performance, but it will catch double frees (most of +// the time), and will often catch allocated-buffer overrun errors. This +// validation is only active when TCMalloc is used as the allocator. +// #define TCMALLOC_VALIDATION #if !defined(TCMALLOC_VALIDATION) -static size_t ExcludeSpaceForMark(size_t size) { return size; (} +static size_t ExcludeSpaceForMark(size_t size) { return size; } static void AddRoomForMark(size_t* size) {} static void ExcludeMarkFromSize(size_t* new_size) {} static void MarkAllocatedRegion(void* ptr) {} |