iliaa Tue Oct 3 19:51:02 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/soap php_schema.c soap.c /php-src/ext/sockets sockets.c /php-src/main/streams filter.c streams.c Log: Last set of zend_hash_init() optimizations http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_schema.c?r1=1.58.2.6.2.2&r2=1.58.2.6.2.3&diff_format=u Index: php-src/ext/soap/php_schema.c diff -u php-src/ext/soap/php_schema.c:1.58.2.6.2.2 php-src/ext/soap/php_schema.c:1.58.2.6.2.3 --- php-src/ext/soap/php_schema.c:1.58.2.6.2.2 Tue Jul 11 14:24:18 2006 +++ php-src/ext/soap/php_schema.c Tue Oct 3 19:51:01 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_schema.c,v 1.58.2.6.2.2 2006/07/11 14:24:18 dmitry Exp $ */ +/* $Id: php_schema.c,v 1.58.2.6.2.3 2006/10/03 19:51:01 iliaa Exp $ */ #include "php_soap.h" #include "libxml/uri.h" @@ -2039,7 +2039,7 @@ xmlNodePtr node; attr->extraAttributes = emalloc(sizeof(HashTable)); - zend_hash_init(attr->extraAttributes, 0, NULL, delete_extra_attribute, 0); + zend_hash_init(attr->extraAttributes, zend_hash_num_elements((*tmp)->extraAttributes), NULL, delete_extra_attribute, 0); zend_hash_copy(attr->extraAttributes, (*tmp)->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); } attr->encode = (*tmp)->encode; @@ -2085,7 +2085,7 @@ if (newAttr->extraAttributes) { xmlNodePtr node; HashTable *ht = emalloc(sizeof(HashTable)); - zend_hash_init(ht, 0, NULL, delete_extra_attribute, 0); + zend_hash_init(ht, zend_hash_num_elements(newAttr->extraAttributes), NULL, delete_extra_attribute, 0); zend_hash_copy(ht, newAttr->extraAttributes, copy_extra_attribute, &node, sizeof(xmlNodePtr)); newAttr->extraAttributes = ht; } http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.15&r2=1.156.2.28.2.16&diff_format=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.156.2.28.2.15 php-src/ext/soap/soap.c:1.156.2.28.2.16 --- php-src/ext/soap/soap.c:1.156.2.28.2.15 Thu Sep 28 11:32:30 2006 +++ php-src/ext/soap/soap.c Tue Oct 3 19:51:01 2006 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.156.2.28.2.15 2006/09/28 11:32:30 bjori Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.16 2006/10/03 19:51:01 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1078,7 +1078,7 @@ zval *ztmp; ALLOC_HASHTABLE(service->class_map); - zend_hash_init(service->class_map, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_init(service->class_map, zend_hash_num_elements((*tmp)->value.ht), NULL, ZVAL_PTR_DTOR, 0); zend_hash_copy(service->class_map, (*tmp)->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &ztmp, sizeof(zval *)); } @@ -1323,7 +1323,7 @@ if (service->soap_functions.ft == NULL) { service->soap_functions.functions_all = FALSE; service->soap_functions.ft = emalloc(sizeof(HashTable)); - zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_init(service->soap_functions.ft, zend_hash_num_elements(Z_ARRVAL_P(function_name)), NULL, ZVAL_PTR_DTOR, 0); } zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(function_name), &pos); http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/sockets.c?r1=1.171.2.9.2.3&r2=1.171.2.9.2.4&diff_format=u Index: php-src/ext/sockets/sockets.c diff -u php-src/ext/sockets/sockets.c:1.171.2.9.2.3 php-src/ext/sockets/sockets.c:1.171.2.9.2.4 --- php-src/ext/sockets/sockets.c:1.171.2.9.2.3 Thu Aug 31 16:15:24 2006 +++ php-src/ext/sockets/sockets.c Tue Oct 3 19:51:01 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sockets.c,v 1.171.2.9.2.3 2006/08/31 16:15:24 tony2001 Exp $ */ +/* $Id: sockets.c,v 1.171.2.9.2.4 2006/10/03 19:51:01 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -568,7 +568,7 @@ if (Z_TYPE_P(sock_array) != IS_ARRAY) return 0; ALLOC_HASHTABLE(new_hash); - zend_hash_init(new_hash, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(sock_array)), NULL, ZVAL_PTR_DTOR, 0); for (zend_hash_internal_pointer_reset(Z_ARRVAL_P(sock_array)); zend_hash_get_current_data(Z_ARRVAL_P(sock_array), (void **) &element) == SUCCESS; zend_hash_move_forward(Z_ARRVAL_P(sock_array))) { http://cvs.php.net/viewvc.cgi/php-src/main/streams/filter.c?r1=1.17.2.3.2.1&r2=1.17.2.3.2.2&diff_format=u Index: php-src/main/streams/filter.c diff -u php-src/main/streams/filter.c:1.17.2.3.2.1 php-src/main/streams/filter.c:1.17.2.3.2.2 --- php-src/main/streams/filter.c:1.17.2.3.2.1 Fri May 19 10:24:05 2006 +++ php-src/main/streams/filter.c Tue Oct 3 19:51:01 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filter.c,v 1.17.2.3.2.1 2006/05/19 10:24:05 tony2001 Exp $ */ +/* $Id: filter.c,v 1.17.2.3.2.2 2006/10/03 19:51:01 iliaa Exp $ */ #include "php.h" #include "php_globals.h" @@ -61,7 +61,7 @@ php_stream_filter_factory tmpfactory; ALLOC_HASHTABLE(FG(stream_filters)); - zend_hash_init(FG(stream_filters), 0, NULL, NULL, 1); + zend_hash_init(FG(stream_filters), zend_hash_num_elements(&stream_filters_hash), NULL, NULL, 1); zend_hash_copy(FG(stream_filters), &stream_filters_hash, NULL, &tmpfactory, sizeof(php_stream_filter_factory)); } http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.7&r2=1.82.2.6.2.8&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.7 php-src/main/streams/streams.c:1.82.2.6.2.8 --- php-src/main/streams/streams.c:1.82.2.6.2.7 Fri Sep 15 07:27:21 2006 +++ php-src/main/streams/streams.c Tue Oct 3 19:51:01 2006 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.82.2.6.2.7 2006/09/15 07:27:21 tony2001 Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.8 2006/10/03 19:51:01 iliaa Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1462,7 +1462,7 @@ php_stream_wrapper *tmp; ALLOC_HASHTABLE(FG(stream_wrappers)); - zend_hash_init(FG(stream_wrappers), 0, NULL, NULL, 1); + zend_hash_init(FG(stream_wrappers), zend_hash_num_elements(&url_stream_wrappers_hash), NULL, NULL, 1); zend_hash_copy(FG(stream_wrappers), &url_stream_wrappers_hash, NULL, &tmp, sizeof(tmp)); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php