Custom malloc/mmap for x86_64

Mike Frysinger
Sat Apr 28 22:03:00 GMT 2012

so you just want to override the malloc implementation ?  glibc is specifically 
designed to allow that at runtime today.

if you create a shared library that exports these functions:
	malloc calloc realloc memalign free

you can use it with LD_PRELOAD and both glibc and your own code will use the 
custom allocator functions on the fly.  then to switch back to the stock glibc 
ones, unset LD_PRELOAD.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the Libc-help mailing list