This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED] malloc/malloc.c : Remove nested function mi_arena.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Rich Felker <dalias at libc dot org>, Ludovic CourtÃs <ludo at gnu dot org>, libc-alpha at sourceware dot org, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Wed, 28 May 2014 22:14:05 -0400
- Subject: Re: [COMMITTED] malloc/malloc.c : Remove nested function mi_arena.
- Authentication-results: sourceware.org; auth=none
- References: <5383536D dot 5010601 at redhat dot com> <87vbssxs50 dot fsf at gnu dot org> <20140528031526 dot GF507 at brightrain dot aerifal dot cx> <5386907E dot 3020602 at redhat dot com>
On 05/28/2014 09:42 PM, Carlos O'Donell wrote:
> On 05/27/2014 11:15 PM, Rich Felker wrote:
>> Despite my being in favor of eliminating nested functions, I'm in
>> complete agreement. This kind of mechanical transformation with
>> pointers to all of the outer function's locals is utterly hideous to
>> read, and makes the compiler's work much more difficult.
>>
>> I'm in favor of the earlier proposal to inline the code directly.
>
> That's 4 in favour after review.
>
> Ondrej, Please feel free to commit your inlining of the function.
I also apologize for not looking closely at the function
in question, and being ideological about trying to keep
the functions as simple as possible. The truth is that as
Rich says, inlining was the better solution.
After I refactored the function I realized it wasn't all
that complex, but by then I'd read the function over a
few times already. I see why Siddhesh also thought inlining
it was the right solution.
Cheers,
Carlos.