This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 5/5] Add single-threaded path to _int_malloc
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Tue, 24 Oct 2017 13:49:50 +0000
- Subject: Re: [PATCH 5/5] Add single-threaded path to _int_malloc
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- References: <DB6PR0801MB20539CD95085834CBBC3939E83430@DB6PR0801MB2053.eurprd08.prod.outlook.com> (message from Wilco Dijkstra on Fri, 20 Oct 2017 14:51:47 +0000),<xna80h4s1x.fsf@greed.delorie.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
DJ Delorie wrote:
>
> Looks good to me.
OK it's all committed now. Thanks for the reviews!
> > We could use the ifunc mechanism to decide between different variants -
> > including for example for the single-thread optimization.
>
> I suspect ifuncs are chosen before we know if the program will spawn any
> threads, though.
I was thinking of dynamically updating the ifunc, for example if we want to trace,
hook or enable more expensive checking. That way there is no need to check
for all special cases on every call, and additional code can be enabled or
disabled at runtime by swapping to a different variant of malloc/free.
Wilco