This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Cleanup code duplication in malloc on fallback to use another arena
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Andreas Schwab <schwab at linux-m68k dot org>, libc-alpha at sourceware dot org
- Date: Wed, 05 Sep 2012 15:04:59 -0300
- Subject: Re: [PATCH] Cleanup code duplication in malloc on fallback to use another arena
- References: <20120830145849.7d2fdf04@spoyarek> <m24nnku33g.fsf@igel.home><20120830154412.5559f6d6@spoyarek> <or392x5up6.fsf@livre.localdomain><20120905162936.323cdf21@spoyarek>
On Sep 5, 2012, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> when a new arena is created, this may result in two mprotect calls on
> the arena, once for 'bytes' and the second time for the aligned
> size. I'll verify this.
Thanks
> If it needs a change, then I think we could do it as a separate fix,
> since this patch is just intended to be a cleanup.
Indeed, I didn't realize the mistake I noticed was present both before
and after your patch.
Your patch looks good to me (minus typos below), so, say, if nobody else
objects within 24 hours, go ahead and check it in!
>> Now, how about renaming get_another_arena to say arena_get_retry, or
>> arena_get3 ;-) for greater similarity with the other functions that
>> choose an arena?
> I don't like arena_get2 as a function name, so I'll hate arena_get3
> even more.
:-D
> arena_get_retry is good though :)
> I've attached the updated patch.
Thanks!
> * malloc/malloc.c (__libc_malloc): Use get_another_arena if the
> current arena cannot fulfil the request.
Typo: fulfill
> (__libc_memalign): Likewise.
> (__libc_memalign): Likewise.
> (__libc_pvalloc): Likewise.
> (__libc_calloc): Likewise.
> + to mmap(), so try one one of the other arenas. */
Typo: one one
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer