summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 16:40:59 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 16:40:59 +0000
commitfd4d226549034acc7b249e0eff537089bd0cd6db (patch)
tree00cdfcf63568c4d9ae9c820b13a2fd1927222581 /third_party/tcmalloc
parent41e91a55d14f4b7dde4fd4bfb5f4f69272af6536 (diff)
downloadchromium_src-fd4d226549034acc7b249e0eff537089bd0cd6db.zip
chromium_src-fd4d226549034acc7b249e0eff537089bd0cd6db.tar.gz
chromium_src-fd4d226549034acc7b249e0eff537089bd0cd6db.tar.bz2
TCMalloc: don't use initialize hook. Just set the hook pointers directly.
Don't do this for memalign since it's already done elsewhere. TODO(willchan): Mimic MemalignOverride and get it working for debugallocation and HeapChecker later. BUG=40974,42171 Review URL: http://codereview.chromium.org/1693003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc')
-rw-r--r--third_party/tcmalloc/chromium/src/tcmalloc.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc
index cb45b0e..6acead8 100644
--- a/third_party/tcmalloc/chromium/src/tcmalloc.cc
+++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc
@@ -362,28 +362,22 @@ static void* tc_ptmalloc_malloc_hook(size_t size, const void* caller) {
return tc_malloc(size);
}
+void* (*__malloc_hook)(
+ size_t size, const void* caller) = tc_ptmalloc_malloc_hook;
+
static void* tc_ptmalloc_realloc_hook(
void* ptr, size_t size, const void* caller) {
return tc_realloc(ptr, size);
}
+void* (*__realloc_hook)(
+ void* ptr, size_t size, const void* caller) = tc_ptmalloc_realloc_hook;
+
static void tc_ptmalloc_free_hook(void* ptr, const void* caller) {
tc_free(ptr);
}
-static void* tc_ptmalloc_memalign_hook(
- size_t alignment, size_t size, const void* caller) {
- return tc_memalign(alignment, size);
-}
-
-static void tc_ptmalloc_init_hook() {
- __malloc_hook = tc_ptmalloc_malloc_hook;
- __realloc_hook = tc_ptmalloc_realloc_hook;
- __free_hook = tc_ptmalloc_free_hook;
- __memalign_hook = tc_ptmalloc_memalign_hook;
-}
-
-void (*__malloc_initialize_hook)() = tc_ptmalloc_init_hook;
+void (*__free_hook)(void* ptr, const void* caller) = tc_ptmalloc_free_hook;
#endif