]> granicus.if.org Git - php/commitdiff
Remove needless zeroing of anonymously mmap'd memory
authorMichael McConville <mmcco@mykolab.com>
Tue, 26 Apr 2016 17:16:38 +0000 (13:16 -0400)
committerJulien Pauli <jpauli@php.net>
Mon, 11 Jul 2016 12:56:17 +0000 (14:56 +0200)
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.

sapi/fpm/fpm/fpm_shm.c
sapi/litespeed/lsapilib.c

index 9226adf3d3f37d33853c316231f44a9029a65f3e..7986056793cf6ddceec232f338fec07da6239fde 100644 (file)
@@ -35,7 +35,6 @@ void *fpm_shm_alloc(size_t size) /* {{{ */
                return NULL;
        }
 
-       memset(mem, 0, size);
        fpm_shm_size += size;
        return mem;
 }
index 75bd30e2b9bfe4688f4bd9e31a3f57df380d407f..be3df2f79ac19fcdba57df03bfdd35e4e364ad05 100644 (file)
@@ -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 );