This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Use accessors for chunk metadata access
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 28 Oct 2016 10:11:53 -0400
- Subject: Re: [PATCH] malloc: Use accessors for chunk metadata access
- Authentication-results: sourceware.org; auth=none
- References: <5443da2a-7b59-929f-c6ce-ad6c19b0f2ea@redhat.com>
On 10/28/2016 09:02 AM, Florian Weimer wrote:
> I verified that malloc/malloc.o on x86_64 is virtually unchanged
> before and after this patch, exception for line numbers and assert
> messages.
This looks good to me and I know that the accessors have the eventual
goal of providing chunk header hardening.
I particularly like that you renamed prev_size and size for safety
to ensure you catch any code other people might have written that
could still function after the conversion e.g. custom downstream
patches. Along with the GCC poison pragma :-)
Can I ask for one thing?
Add a 'chunk_main_arena()' accessor to cleanup the double-negatives
in the code e.g. assert (! chunk_non_main_arena (bck->bk));
Or rename it because it's only ever used in double negatives:
chunk_main_arena
chunk_main_heap
etc.
Please keep 'main' somewhere in the name to indicate that this is
the main arena.
OK to checkin with that one tweak.
--
Cheers,
Carlos.