Unless I'm misunderstanding something, anonymously mmapped memory is always zeroed by the kernel and this memset call is therefore redundant. Best, Michael Index: rrl.c ==================================================================--- rrl.c (revision 4584) +++ rrl.c (working copy) @@ -90,8 +90,6 @@ strerror(errno)); exit(1); } - memset(rrl_maps[i], 0, - sizeof(struct rrl_bucket)*rrl_array_size); } #else (void)numch;
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 kernelThis is written in Linux mmap man page:> its contents are initialized to zeroBut 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.