This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: extend dl-minimal malloc implementation
- From: Zack Weinberg <zackw at panix dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: "Carlos O'Donell" <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 16 Aug 2017 21:00:15 -0400
- Subject: Re: extend dl-minimal malloc implementation
- Authentication-results: sourceware.org; auth=none
- References: <8a08bf67-7599-b8df-ce33-2a7cc4cee1c5@redhat.com> <xnmv6zbeel.fsf@greed.delorie.com>
On Wed, Aug 16, 2017 at 1:39 PM, DJ Delorie <dj@redhat.com> wrote:
>
> "Carlos O'Donell" <carlos@redhat.com> writes:
>> (b) Eliminate all alloca by moving to malloc (requires (a)).
>
> I will point out the obvious, for the record, that doing (b) may be
> arbitrarily non-trivial.
>
> I've looked at some of the alloca code in ld.so and the original
> programmers (rightly) took advantage of the auto-cleanup, resulting in
> code that might be difficult to convert.
What I was trying to suggest, earlier, was that *before* either (a) or
(b) we should go through the entire of ld.so and try to *remove* as
many allocations as possible, at which point it might make sense not
to have malloc in there at all - "just" send all remaining allocations
directly to mmap (not sbrk; leave sbrk for the "real" malloc). That
may take rearchitecting - but so may just converting alloca to malloc,
as you point out. I admit I have no idea whether this is even
feasible.
zw