diff options
author | Dmitry Stogov <dmitry@zend.com> | 2017-06-21 10:37:54 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2017-06-21 10:37:54 +0300 |
commit | c16f954ff199abe1cd83f97897c3c65d82e92961 (patch) | |
tree | f3af1eeae738565cceef351ca95f659f185f108c /ext/opcache/zend_shared_alloc.c | |
parent | 1dfb63feca0fd4ae7f95d93d7291e4711b498b1f (diff) | |
download | php-git-c16f954ff199abe1cd83f97897c3c65d82e92961.tar.gz |
Clear alocated memory blocks, only if this is really necessary.
Diffstat (limited to 'ext/opcache/zend_shared_alloc.c')
-rw-r--r-- | ext/opcache/zend_shared_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index b7940ad39b..738c6285d2 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -230,6 +230,7 @@ int zend_shared_alloc_startup(size_t requested_size) zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!"); return ALLOC_FAILURE;; } + memset(p_tmp_shared_globals, 0, sizeof(zend_smm_shared_globals)); tmp_shared_segments = zend_shared_alloc(shared_segments_array_size + ZSMMG(shared_segments_count) * sizeof(void *)); if (!tmp_shared_segments) { @@ -325,7 +326,6 @@ void *zend_shared_alloc(size_t size) ZSMMG(shared_segments)[i]->pos += block_size; ZSMMG(shared_free) -= block_size; - memset(retval, 0, block_size); ZEND_ASSERT(((zend_uintptr_t)retval & 0x7) == 0); /* should be 8 byte aligned */ return retval; } |