Re: regression in multi-threaded git-pack-index
- From
Jeff King <peff@peff.net>
- Date
- Mar 19, 2013, 10:47 UTC
- Message-ID
- <20130319104759.GB9490@sigill.intra.peff.net>
- In-Reply-To
- <871ubb8y6z.fsf@pctrast.inf.ethz.ch>
On Tue, Mar 19, 2013 at 11:45:56AM +0100, Thomas Rast wrote:
Show 14 quoted lines
> Now consider
>
> // somewhere on the stack
> struct foo {
> char c;
> int i;
> } a, b;
> a.c = a.i = 0;
>
> memcpy(&b, &a, sizeof(struct foo));
>
> The compiler could legitimately leave the padding between c and i
> uninitialized, and with your proposed "early" reporting the memcpy would
> complain.Ah, good point. And valgrind does not have any way of knowing what is padding and what is not, since it sees only the compiled contents. Probably llvm's memory checker support could do a better job there.
-Peff