com php-src: Removed useless code: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache /zend_accelerator_util_funcs.h

From: Date: Wed, 22 Oct 2014 18:32:06 +0000
Subject: com php-src: Removed useless code: ext/opcache/ZendAccelerator.c ext/opcache/zend_accelerator_util_funcs.c ext/opcache /zend_accelerator_util_funcs.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82447@lists.php.net to get a copy of this message
Commit: 62e3998dae44619b123acba4bb9578c45c83526f Author: Dmitry Stogov <dmitry@zend.com> Wed, 22 Oct 2014 22:32:06 +0400 Parents: 8dedd863bc131dcbf4b4cac62f9fba2c744b2723 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=62e3998dae44619b123acba4bb9578c45c83526f Log: Removed useless code Changed paths: M ext/opcache/ZendAccelerator.c M ext/opcache/zend_accelerator_util_funcs.c M ext/opcache/zend_accelerator_util_funcs.h Diff: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator..c index d36827b..b5d446a 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1127,10 +1127,6 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr return new_persistent_script; } - if (!compact_persistent_script(new_persistent_script)) { - return new_persistent_script; - } - /* exclusive lock */ zend_shared_alloc_lock(TSRMLS_C); diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index ee7be50..2268324 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -88,64 +88,6 @@ zend_persistent_script* create_persistent_script(void) return persistent_script; } -static int compact_hash_table(HashTable *ht) -{ - uint i = 3; - uint j; - uint nSize; - Bucket *d; - Bucket *p; - - if (!ht->nNumOfElements || (ht->u.flags & HASH_FLAG_PACKED)) { - /* Empty tables don't allocate space for Buckets */ - return 1; - } - - if (ht->nNumOfElements >= 0x80000000) { - /* prevent overflow */ - nSize = 0x80000000; - } else { - while ((1U << i) < ht->nNumOfElements) { - i++; - } - nSize = 1 << i; - } - - if (nSize >= ht->nTableSize) { - /* Keep the size */ - return 1; - } - - d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(uint32_t)), ht->u.flags & HASH_FLAG_PERSISTENT); - if (!d) { - return 0; - } - - for (i = 0, j = 0; i < ht->nNumUsed; i++) { - p = ht->arData + i; - if (Z_TYPE(p->val) != IS_UNDEF) { - d[j++] = *p; - } - } - ht->nNumUsed = j; - - pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT); - - ht->arData = d; - ht->arHash = (uint32_t *)(d + nSize); - ht->nTableSize = nSize; - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - - return 1; -} - -int compact_persistent_script(zend_persistent_script *persistent_script) -{ - return compact_hash_table(&persistent_script->function_table) && - compact_hash_table(&persistent_script->class_table); -} - void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements) { if (destroy_elements) { diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index 2f515d8..cbcb2ff 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -28,7 +28,6 @@ void zend_accel_copy_internal_functions(TSRMLS_D); zend_persistent_script* create_persistent_script(void); -int compact_persistent_script(zend_persistent_script *script); void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements); void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC);

« previous php.cvs (#82447) next »