public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] malloc: Use accessors for chunk metadata access
Date: Fri, 28 Oct 2016 14:11:00 -0000	[thread overview]
Message-ID: <ecf5b276-48fd-e1f9-9628-1880d0cdd608@redhat.com> (raw)
In-Reply-To: <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.

  reply	other threads:[~2016-10-28 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 13:03 Florian Weimer
2016-10-28 14:11 ` Carlos O'Donell [this message]
2016-10-28 14:52   ` Florian Weimer
2016-10-28 15:07     ` Carlos O'Donell
2016-10-28 20:39       ` Florian Weimer
2016-10-28 20:51         ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecf5b276-48fd-e1f9-9628-1880d0cdd608@redhat.com \
    --to=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).