From d8b6060f045d93d6b0cfb6a0d8e80fc100df1749 Mon Sep 17 00:00:00 2001 From: "glider@chromium.org" Date: Fri, 26 Mar 2010 09:41:22 +0000 Subject: Add the linux_use_heapchecker GYP variable that should turn the tcmalloc heap lleak checker on and off. Review URL: http://codereview.chromium.org/1334002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42740 0039d316-1c4b-4281-b951-d872f2087c98 --- base/allocator/allocator.gyp | 14 ++++++++++++-- base/leak_annotations.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'base') diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index 0734d2e..b8df28f 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp @@ -332,9 +332,19 @@ # 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', + ], + }], ], }, { diff --git a/base/leak_annotations.h b/base/leak_annotations.h index 8b5c2ad..a402acf 100644 --- a/base/leak_annotations.h +++ b/base/leak_annotations.h @@ -7,7 +7,7 @@ #include "build/build_config.h" -#if defined(OS_LINUX) && defined(USE_TCMALLOC) +#if defined(OS_LINUX) && defined(USE_HEAPCHECKER) #include "third_party/tcmalloc/chromium/src/google/heap-checker.h" -- cgit v1.1