Skip to content

Commit

Permalink
Add the linux_use_heapchecker GYP variable that should turn the tcmal…
Browse files Browse the repository at this point in the history
…loc 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
  • Loading branch information
glider@chromium.org committed Mar 26, 2010
1 parent 1fa0c35 commit d8b6060
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
14 changes: 12 additions & 2 deletions base/allocator/allocator.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
}],
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion base/leak_annotations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 5 additions & 0 deletions build/build_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
#define USE_TCMALLOC 1
#endif

// Use heapchecker.
#if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(NO_HEAPCHECKER)
#define USE_HEAPCHECKER 1
#endif

// Compiler detection.
#if defined(__GNUC__)
#define COMPILER_GCC 1
Expand Down
9 changes: 9 additions & 0 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@
# Enable TCMalloc.
'linux_use_tcmalloc%': 1,

# Disable TCMalloc's heapchecker.
'linux_use_heapchecker%': 0,

# Set to select the Title Case versions of strings in GRD files.
'use_titlecase_in_grd_files%': 0,

Expand Down Expand Up @@ -965,9 +968,15 @@
}]
],
}],
['linux_use_heapchecker==1', {
'variables': {'linux_use_tcmalloc%': 1},
}],
['linux_use_tcmalloc==0', {
'defines': ['NO_TCMALLOC'],
}],
['linux_use_heapchecker==0', {
'defines': ['NO_HEAPCHECKER'],
}],
],
},
}],
Expand Down

0 comments on commit d8b6060

Please sign in to comment.