[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    Re: [PATCH] Fix --enable-checking of libcpp, add valgrind workarounds
From:       Jakub Jelinek <jakub () redhat ! com>
Date:       2013-02-27 22:16:31
Message-ID: 20130227221631.GT12913 () tucnak ! redhat ! com
[Download RAW message or body]

On Wed, Feb 27, 2013 at 03:06:03PM -0700, Jeff Law wrote:
> Presumably there's a good reason why we don't put __cpp_buff at the
> start of the structure all the time?  From a purely maintenance
> standpoint that seems better

I think there are two reasons, one is mentioned in the function comment
(already from 3.2 or older era):
/* Create a new allocation buffer.  Place the control block at the end
   of the buffer, so that buffer overflows will cause immediate chaos.  */

and the other reason I'd say is that by putting the buffer first we increase
the chances the actual buffer is more aligned (especially for very large
allocations for which e.g. glibc malloc would use mmap).  If it were
affecting more than two functions, I'd understand the maintainance burden
side, but as it is two tiny spots and valgrind checking is something people
normally do just a couple of times per release cycle (and as my current
--leak-check=full attempts show, perhaps even less than that, the amount of
still unfixed issues is huge), I think it is fine as is.

	Jakub
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic