[PATCH] Hook jemalloc into glibc's malloc

Jason Evans jasone at canonware.com
Wed Feb 29 10:47:52 PST 2012


On Feb 21, 2012, at 7:39 AM, Mike Hommey wrote:
> When jemalloc is used as a libc malloc replacement (i.e. not prefixed),
> some particular setups may end up inconsistently calling malloc from
> libc and free from jemalloc, or the other way around.
> 
> Glibc provides hooks to make its functions use alternative
> implementations. Use them.
> 
> Original patch by: Karl Tomlinson <karlt+ at karlt.net>


I committed the important part of this:

	http://www.canonware.com/cgi-bin/gitweb.cgi?p=jemalloc.git;a=commitdiff;h=4bb09830133ffa8b27a95bc3727558007722c152

The configure.ac change caused mysterious failures if the AC_MSG_ERROR([dlfcn.h is missing]) statement was actually executed.  I came up with a workaround, but in the end left that part of the change out completely, because I don't think it makes sense to #error just because some poorly behaved applications that use RTLD_DEEPBIND might break.

Thanks,
Jason





More information about the jemalloc-discuss mailing list