From: Michael McConville Date: Tue, 26 Apr 2016 17:16:38 +0000 (-0400) Subject: Remove needless zeroing of anonymously mmap'd memory X-Git-Tag: php-7.1.0beta1~109^2^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dd5d96332b2562010de6b1a48fdcb5d3db43ea0;p=php Remove needless zeroing of anonymously mmap'd memory All existing systems zero anonymously mmapped memory, and if I understand correctly POSIX will be specifying this soon. Many projects already rely on it, so no reasonable system would return memory of unspecified value. --- diff --git a/sapi/fpm/fpm/fpm_shm.c b/sapi/fpm/fpm/fpm_shm.c index 9226adf3d3..7986056793 100644 --- a/sapi/fpm/fpm/fpm_shm.c +++ b/sapi/fpm/fpm/fpm_shm.c @@ -35,7 +35,6 @@ void *fpm_shm_alloc(size_t size) /* {{{ */ return NULL; } - memset(mem, 0, size); fpm_shm_size += size; return mem; } diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 75bd30e2b9..be3df2f79a 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2639,7 +2639,6 @@ static int lsapi_init_children_status() perror( "Anonymous mmap() failed" ); return -1; } - memset( pBuf, 0, size ); g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status );