Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120824175251.GF27715@brightrain.aerifal.cx>
Date: Fri, 24 Aug 2012 13:52:51 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: build musl with clang

On Fri, Aug 24, 2012 at 07:37:49PM +0200, Luca Barbato wrote:
> On 8/23/12 7:55 PM, Rich Felker wrote:
> >for (i=0; i<n; i++) if (mem[i]) mem[i] = 0;
> >
> >I am not willing to remove the if, because it serves a valuable
> >purpose: it avoids writing to pages that are already all-zero, which
> >in turn reduces swap pressure/dirty pages.
> 
> Are you sure absolutely sure it does have the intended effect?

Yes. And actually the problematic code is not that, but the [-1] index
to inspect whether the chunk was obtained from the heap or via mmap.
In the latter case, no zeroing is needed whatsoever.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.