This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Cleanup code duplication in malloc on fallback to use another arena


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]