This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Should malloc-related functions be weak?
- From: Pedro Alves <palves at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, DJ Delorie <dj at redhat dot com>
- Cc: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Mon, 1 Aug 2016 12:04:43 +0100
- Subject: Re: Should malloc-related functions be weak?
- Authentication-results: sourceware.org; auth=none
- References: <87eg6cuwp7.fsf@totoro.br.ibm.com> <xnbn1ed1p8.fsf@greed.delorie.com> <87oa5d29xf.fsf@mid.deneb.enyo.de> <7514658e-ead9-1c3e-5fa2-5a6afc9cb54f@redhat.com> <18b45fce-98fa-fd2a-4a24-bbcbad649b64@redhat.com>
On 08/01/2016 11:39 AM, Florian Weimer wrote:
> On 08/01/2016 12:25 PM, Pedro Alves wrote:
>> Are these other symbols meant be overridden?
>
> These symbols (__malloc_fork_lock_parent etc.) are not supposed to be
> overridden, they are entirely internal to glibc and its malloc
> implementation. If the glibc malloc is interposed, these functions
> should not do anything.
Hmm, doesn't an interposing malloc need to worry about the same
scenarios these hooks were invented for?
Say I copy glibc malloc to my project, and tweak it somehow for my
workloads. How can I make my copy work just as correctly as the
builtin one?
Thanks,
Pedro Alves