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