From 39ca7de68778d0987c7308d5e6c19886c2bbcfc6 Mon Sep 17 00:00:00 2001 From: "glider@chromium.org" Date: Fri, 16 Apr 2010 08:04:03 +0000 Subject: Add the linux_use_debugallocation flag. Setting this flag to 1 shall force the use of debugallocation.cc instead of tcmalloc.cc The flag is off by default because it still needs testing. BUG=30715 Review URL: http://codereview.chromium.org/1513043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44759 0039d316-1c4b-4281-b951-d872f2087c98 --- base/allocator/allocator.gyp | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'base/allocator') diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index b8df28f..a4a4edd 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp @@ -206,7 +206,6 @@ '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h', '<(tcmalloc_dir)/src/base/stl_allocator.h', '<(tcmalloc_dir)/src/base/thread_annotations.h', - '<(tcmalloc_dir)/src/debugallocation.cc', '<(tcmalloc_dir)/src/getpc.h', '<(tcmalloc_dir)/src/google/heap-checker.h', '<(tcmalloc_dir)/src/google/heap-profiler.h', @@ -301,6 +300,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=="openbsd"', { @@ -332,19 +334,33 @@ # Do the same for heap leak checker. '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', - ]}, - }], - [ 'linux_use_heapchecker==0', { - # Do not compile and link the heapchecker source. - 'sources!': [ - '<(tcmalloc_dir)/src/heap-checker-bcad.cc', - '<(tcmalloc_dir)/src/heap-checker.cc', - ], - # Disable the heap checker in tcmalloc. - 'cflags': [ - '-DNO_HEAP_CHECK', - ], - }], + ]}, + }], + [ 'linux_use_debugallocation==1', { + 'sources!': [ + # debugallocation.cc #includes tcmalloc.cc, + # so only one of them should be used. + '<(tcmalloc_dir)/src/tcmalloc.cc', + ], + 'cflags': [ + '-DTCMALLOC_FOR_DEBUGALLOCATION', + ], + }, { # linux_use_debugallocation != 1 + 'sources!': [ + '<(tcmalloc_dir)/src/debugallocation.cc', + ], + }], + [ 'linux_use_heapchecker==0', { + # Do not compile and link the heapchecker source. + 'sources!': [ + '<(tcmalloc_dir)/src/heap-checker-bcad.cc', + '<(tcmalloc_dir)/src/heap-checker.cc', + ], + # Disable the heap checker in tcmalloc. + 'cflags': [ + '-DNO_HEAP_CHECK', + ], + }], ], }, { -- cgit v1.1