From: Zachary T. <div...@gm...> - 2009-07-17 01:21:57
|
On Thu, Jul 16, 2009 at 7:47 PM, Nicholas Nethercote<n.n...@gm...> wrote: > On Fri, Jul 17, 2009 at 2:16 AM, Zachary Turner<div...@gm...> wrote: >> --track-origins=yes I find that the memory it's claiming is >> uninitialized comes from sbrk(). As far as I can tell (please correct >> me if I'm wrong) this function is guaranteed to return 0-filled >> memory > > I'm not at all certain this is the case, which is why Memcheck marks > it as undefined. Evidence to the contrary would be welcome! > > Nick > I'm not certain either :) When I google around it seems about 50/50 with some saying it does and some saying it doesn't. But it might be platform dependent. The glibc source code's implementation of malloc uses sbrk and has a comment that says "since sbrk() returns 0-filled memory, we don't need to initialize the entire buffer." or something to that effect. |