Subject: bug#22086: 25.1.50; [PATCH] Integrate the musl hybrid malloc patch for elf systems

From: Paul Eggert <[email-masked]>
Date: Mon, 21 Dec 2015 09:06:20 -0800

Wolfgang Jenkner wrote:
>> The simpler approach is to remove gmalloc.c, and to use the system
>> >memory allocator, i.e., to behave as if SYSTEM_MALLOC is defined on
>> >all platforms.
> The system malloc can't manage the "static heap" array implemented in
> sheap.c (because usually there's no malloc_hook), so, presumably this
> would be ditched as well.  So... I wonder what you are proposing here.

If we don't need the static heap, then let's ditch it. If we do need it, then 
let's have our own allocator (named emalloc, say), which uses the static heap 
and/or the system malloc as needed. Regardless, we shouldn't be trying to 
redefine 'malloc', nor should we be supplying our own allocator merely because 
that was a good idea back in 1989.