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

Siddhesh Poyarekar siddhesh@redhat.com
Thu Aug 30 09:29:00 GMT 2012


Hi,

While reading through the malloc code, I found that the code to find
another arena when the current arena cannot fulfil a request, is
duplicated in multiple calls.  This can be implemented in a single
function and that function called in all those places, which is what
this patch does.

The purpose of this cleanup is just to make the code a little bit
neater and hence readable. The change does not cause any regressions in
the testsuite on my Fedora 16 x86_64. OK to commit?

Regards,
Siddhesh

ChangeLog:

	* malloc/malloc.c (get_another_arena): New function that gets
	another arena for the caller to try its request on.
	(__libc_malloc): Use get_another_arena if the current arena
	cannot fulfil the request.
	(__libc_memalign): Likewise.
	(__libc_memalign): Likewise.
	(__libc_pvalloc): Likewise.
	(__libc_calloc): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-other-arena.patch
Type: text/x-patch
Size: 5956 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120830/d63d2dc1/attachment.bin>


More information about the Libc-alpha mailing list