cvs: ZendEngine2(PHP_5_3) / zend_execute_API.c
[email protected] ("Dmitry Stogov") Wed, 08 Apr 2009 13:17:58 -0000
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsdmitry1239196678@cvsserver> |
dmitry Wed Apr 8 13:17:58 2009 UTC
Modified files: (Branch: PHP_5_3)
/ZendEngine2 zend_execute_API.c
Log:
Calculate hash value once
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.75&r2=1.331.2.20.2.24.2.76&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.75 ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.76
--- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.75 Thu Mar 19 18:34:16 2009
+++ ZendEngine2/zend_execute_API.c Wed Apr 8 13:17:58 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.75 2009/03/19 18:34:16 mattwil Exp $ */
+/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.76 2009/04/08 13:17:58 dmitry Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -1020,6 +1020,7 @@
zend_fcall_info fcall_info;
zend_fcall_info_cache fcall_cache;
char dummy = 1;
+ ulong hash;
ALLOCA_FLAG(use_heap)
if (name == NULL || !name_length) {
@@ -1035,7 +1036,9 @@
lc_length -= 1;
}
- if (zend_hash_find(EG(class_table), lc_name, lc_length, (void **) ce) == SUCCESS) {
+ hash = zend_inline_hash_func(lc_name, lc_length);
+
+ if (zend_hash_quick_find(EG(class_table), lc_name, lc_length, hash, (void **) ce) == SUCCESS) {
free_alloca(lc_free, use_heap);
return SUCCESS;
}
@@ -1053,7 +1056,7 @@
zend_hash_init(EG(in_autoload), 0, NULL, NULL, 0);
}
- if (zend_hash_add(EG(in_autoload), lc_name, lc_length, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
+ if (zend_hash_quick_add(EG(in_autoload), lc_name, lc_length, hash, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
free_alloca(lc_free, use_heap);
return FAILURE;
}
@@ -1090,7 +1093,7 @@
zval_ptr_dtor(&class_name_ptr);
- zend_hash_del(EG(in_autoload), lc_name, lc_length);
+ zend_hash_quick_del(EG(in_autoload), lc_name, lc_length, hash);
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
@@ -1101,7 +1104,7 @@
return FAILURE;
}
- retval = zend_hash_find(EG(class_table), lc_name, lc_length, (void **) ce);
+ retval = zend_hash_quick_find(EG(class_table), lc_name, lc_length, hash, (void **) ce);
free_alloca(lc_free, use_heap);
return retval;
}