[nsd-users] Remove needless memory zeroing

Daisuke HIGASHI daisuke.higashi at gmail.com
Tue Jan 19 19:52:34 UTC 2016


New upcoming POSIX will standardize mmap(MAP_ANON),
which says that zero-filling is mandatory:
   http://austingroupbugs.net/view.php?id=850

I agree to do memset(0) until new standard prevails, too.


2016-01-20 1:42 GMT+09:00 Stephane Bortzmeyer <bortzmeyer at nic.fr>:
> 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.
>
> _______________________________________________
> nsd-users mailing list
> nsd-users at NLnetLabs.nl
> http://open.nlnetlabs.nl/mailman/listinfo/nsd-users



More information about the nsd-users mailing list