logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: ZendEngine2 / zend_API.c zend_compile.c zend_variables.c: msg#00002

Subject: cvs: ZendEngine2 / zend_API.c zend_compile.c zend_variables.c
dmitry          Tue Oct  3 11:10:54 2006 UTC

  Modified files:              
    /ZendEngine2        zend_API.c zend_compile.c zend_variables.c 
  Log:
  Speedup array/HashTable copying. (Matt W)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.407&r2=1.408&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.407 ZendEngine2/zend_API.c:1.408
--- ZendEngine2/zend_API.c:1.407        Thu Sep 21 23:58:06 2006
+++ ZendEngine2/zend_API.c      Tue Oct  3 11:10:54 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.407 2006/09/21 23:58:06 pollita Exp $ */
+/* $Id: zend_API.c,v 1.408 2006/10/03 11:10:54 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -1221,7 +1221,7 @@
 #else
                        ALLOC_HASHTABLE(class_type->static_members);
 #endif
-                       zend_u_hash_init(CE_STATIC_MEMBERS(class_type), 0, 
NULL, ZVAL_PTR_DTOR, 0, UG(unicode));
+                       zend_u_hash_init(CE_STATIC_MEMBERS(class_type), 
zend_hash_num_elements(&class_type->default_static_members), NULL, 
ZVAL_PTR_DTOR, 0, UG(unicode));
 
                        
zend_hash_internal_pointer_reset_ex(&class_type->default_static_members, &pos);
                        while 
(zend_hash_get_current_data_ex(&class_type->default_static_members, (void**)&p, 
&pos) == SUCCESS) {
@@ -1291,7 +1291,7 @@
                        object->properties = properties;
                } else {
                        ALLOC_HASHTABLE_REL(object->properties);
-                       zend_u_hash_init(object->properties, 0, NULL, 
ZVAL_PTR_DTOR, 0, UG(unicode));
+                       zend_u_hash_init(object->properties, 
zend_hash_num_elements(&class_type->default_properties), NULL, ZVAL_PTR_DTOR, 
0, UG(unicode));
                        zend_hash_copy(object->properties, 
&class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) 
&tmp, sizeof(zval *));
                }
        } else {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.724&r2=1.725&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.724 ZendEngine2/zend_compile.c:1.725
--- ZendEngine2/zend_compile.c:1.724    Tue Sep 19 21:35:59 2006
+++ ZendEngine2/zend_compile.c  Tue Oct  3 11:10:54 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.724 2006/09/19 21:35:59 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.725 2006/10/03 11:10:54 dmitry Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -1926,7 +1926,7 @@
                        zval *tmp_zval;
 
                        ALLOC_HASHTABLE(op_array->static_variables);
-                       zend_u_hash_init(op_array->static_variables, 2, NULL, 
ZVAL_PTR_DTOR, 0, UG(unicode));
+                       zend_u_hash_init(op_array->static_variables, 
zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0, UG(unicode));
                        zend_hash_copy(op_array->static_variables, 
static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_zval, 
sizeof(zval *));
                }
        }
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_variables.c?r1=1.67&r2=1.68&diff_format=u
Index: ZendEngine2/zend_variables.c
diff -u ZendEngine2/zend_variables.c:1.67 ZendEngine2/zend_variables.c:1.68
--- ZendEngine2/zend_variables.c:1.67   Tue Feb 21 08:00:39 2006
+++ ZendEngine2/zend_variables.c        Tue Oct  3 11:10:54 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_variables.c,v 1.67 2006/02/21 08:00:39 dmitry Exp $ */
+/* $Id: zend_variables.c,v 1.68 2006/10/03 11:10:54 dmitry Exp $ */
 
 #include <stdio.h>
 #include "zend.h"
@@ -157,7 +157,7 @@
                                        return; /* do nothing */
                                }
                                ALLOC_HASHTABLE_REL(tmp_ht);
-                               zend_u_hash_init(tmp_ht, 0, NULL, 
ZVAL_PTR_DTOR, 0, original_ht->unicode);
+                               zend_u_hash_init(tmp_ht, 
zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0, 
original_ht->unicode);
                                zend_hash_copy(tmp_ht, original_ht, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
                                Z_ARRVAL_P(zvalue) = tmp_ht;
                        }

-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>