[nsd-users] Remove needless memory zeroing

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jan 19 21:20:28 UTC 2016


On Tue, Jan 19, 2016 at 05:42:41PM +0100, Stephane Bortzmeyer wrote:
> On Mon, Jan 18, 2016 at 10:46:03PM -0500,
>  Michael McConville <mmcco at mykolab.com> wrote 
>  a message of 24 lines which said:
> 
> > Unless I'm misunderstanding something, anonymously mmapped memory is
> > always zeroed by the kernel
> 
> This is written in Linux mmap man page:
> 
> > its contents are initialized to zero
> 
> But not in FreeBSD mmap man page:
> 
> >     MAP_ANON           Map anonymous memory not associated with any specific
> >                        file.  The file descriptor used for creating MAP_ANON
> >                        must be -1.  The offset argument must be 0.
> 
> So, portability seems to require mmset.

It doesn't. If anything, it is a bug in the FreeBSD man page.

Joerg



More information about the nsd-users mailing list