diff options
author | scottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 01:00:08 +0000 |
---|---|---|
committer | scottmg@google.com <scottmg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 01:00:08 +0000 |
commit | ff2367e21e86d78b8bf25fc9048f6ef9cbc618f5 (patch) | |
tree | 50119f1f5715d4c01371407ef4242e3110f2f971 /base/allocator | |
parent | 31ac9481b773b39b888e0824a3ce9bd4b68e75c7 (diff) | |
download | chromium_src-ff2367e21e86d78b8bf25fc9048f6ef9cbc618f5.zip chromium_src-ff2367e21e86d78b8bf25fc9048f6ef9cbc618f5.tar.gz chromium_src-ff2367e21e86d78b8bf25fc9048f6ef9cbc618f5.tar.bz2 |
Revert 166547 - Use tcmalloc's debugallocation for Debug builds
to catch memory problems early, easily, and cleanly.
Because of gyp limitations, this can't be now controlled
by a flag.
BUG=30715
TEST=none
Review URL: https://codereview.chromium.org/11266019
TBR=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/11366141
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/allocator')
-rw-r--r-- | base/allocator/allocator.gyp | 39 | ||||
-rw-r--r-- | base/allocator/allocator_shim.cc | 2 | ||||
-rw-r--r-- | base/allocator/debugallocation_shim.cc | 9 |
3 files changed, 19 insertions, 31 deletions
diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index fc4b902..f669298 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp @@ -203,7 +203,6 @@ 'allocator_shim.cc', 'allocator_shim.h', - 'debugallocation_shim.cc', 'generic_allocators.cc', 'win_allocator.cc', ], @@ -213,10 +212,6 @@ 'generic_allocators.cc', 'win_allocator.cc', - # Included by debugallocation_shim.cc. - '<(tcmalloc_dir)/src/debugallocation.cc', - '<(tcmalloc_dir)/src/tcmalloc.cc', - # We simply don't use these, but list them above so that IDE # users can view the full available source for reference, etc. '<(tcmalloc_dir)/src/addressmap-inl.h', @@ -305,21 +300,6 @@ 'RuntimeLibrary': '0', }, }, - 'variables': { - # Provide a way to force disable debugallocation in Debug builds, - # e.g. for profiling (it's more rare to profile Debug builds, - # but people sometimes need to do that). - 'disable_debugallocation%': 0, - }, - 'conditions': [ - ['disable_debugallocation==0', { - 'defines': [ - # Use debugallocation for Debug builds to catch problems early - # and cleanly, http://crbug.com/30715 . - 'TCMALLOC_FOR_DEBUGALLOCATION', - ], - }], - ], }, }, 'conditions': [ @@ -366,7 +346,7 @@ '<(tcmalloc_dir)/src/system-alloc.h', # included by allocator_shim.cc - 'debugallocation_shim.cc', + '<(tcmalloc_dir)/src/tcmalloc.cc', # heap-profiler/checker/cpuprofiler '<(tcmalloc_dir)/src/base/thread_lister.c', @@ -385,6 +365,9 @@ '<(tcmalloc_dir)/src/profile-handler.cc', '<(tcmalloc_dir)/src/profile-handler.h', '<(tcmalloc_dir)/src/profiler.cc', + + # debugallocation + '<(tcmalloc_dir)/src/debugallocation.cc', ], }], ['OS=="linux" or OS=="freebsd" or OS=="solaris"', { @@ -431,6 +414,20 @@ '-fvtable-verify=preinit', ], }], + [ 'linux_use_debugallocation==1', { + 'sources!': [ + # debugallocation.cc #includes tcmalloc.cc, + # so only one of them should be used. + '<(tcmalloc_dir)/src/tcmalloc.cc', + ], + 'defines': [ + 'TCMALLOC_FOR_DEBUGALLOCATION', + ], + }, { # linux_use_debugallocation != 1 + 'sources!': [ + '<(tcmalloc_dir)/src/debugallocation.cc', + ], + }], [ 'linux_keep_shadow_stacks==1', { 'sources': [ '<(tcmalloc_dir)/src/linux_shadow_stacks.cc', diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index 5acc533..bcc84aa 100644 --- a/base/allocator/allocator_shim.cc +++ b/base/allocator/allocator_shim.cc @@ -56,7 +56,7 @@ static const char secondary_name[] = "CHROME_ALLOCATOR_2"; // We include tcmalloc and the win_allocator to get as much inlining as // possible. -#include "debugallocation_shim.cc" +#include "tcmalloc.cc" #include "win_allocator.cc" // Forward declarations from jemalloc. diff --git a/base/allocator/debugallocation_shim.cc b/base/allocator/debugallocation_shim.cc deleted file mode 100644 index d1cf52a..0000000 --- a/base/allocator/debugallocation_shim.cc +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 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. - -#if defined(TCMALLOC_FOR_DEBUGALLOCATION) -#include "third_party/tcmalloc/chromium/src/debugallocation.cc" -#else -#include "third_party/tcmalloc/chromium/src/tcmalloc.cc" -#endif |