From 5c710cee783a44061fa2c467ffd8984b8047b90e Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 23 May 2012 16:09:22 -0700 Subject: [PATCH] Remove const from __*_hook variable declarations. Remove const from __*_hook variable declarations, so that glibc can modify them during process forking. --- ChangeLog | 2 ++ src/jemalloc.c | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80a21e79..66f1d691 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ found in the git revision history: Bug fixes: - Fix heap profiling crash if sampled object is freed via realloc(p, 0). + - Remove const from __*_hook variable declarations, so that glibc can modify + them during process forking. * 3.0.0 (May 11, 2012) diff --git a/src/jemalloc.c b/src/jemalloc.c index 481936dc..1ab8a1cf 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -1265,11 +1265,10 @@ je_valloc(size_t size) * passed an extra argument for the caller return address, which will be * ignored. */ -JEMALLOC_EXPORT void (* const __free_hook)(void *ptr) = je_free; -JEMALLOC_EXPORT void *(* const __malloc_hook)(size_t size) = je_malloc; -JEMALLOC_EXPORT void *(* const __realloc_hook)(void *ptr, size_t size) = - je_realloc; -JEMALLOC_EXPORT void *(* const __memalign_hook)(size_t alignment, size_t size) = +JEMALLOC_EXPORT void (* __free_hook)(void *ptr) = je_free; +JEMALLOC_EXPORT void *(* __malloc_hook)(size_t size) = je_malloc; +JEMALLOC_EXPORT void *(* __realloc_hook)(void *ptr, size_t size) = je_realloc; +JEMALLOC_EXPORT void *(* __memalign_hook)(size_t alignment, size_t size) = je_memalign; #endif