- allocate known count of HashTables entries on init
authorMichael Wallner <mike@php.net>
Wed, 29 Mar 2006 12:38:01 +0000 (12:38 +0000)
committerMichael Wallner <mike@php.net>
Wed, 29 Mar 2006 12:38:01 +0000 (12:38 +0000)
http_querystring_object.c
http_request_object.c
http_requestpool_object.c

index 55d355d8e480bc6840de2d2c74aaf11c61717020..70c68cf5bf441b5ef25555cd31453d2332449a04 100644 (file)
@@ -162,7 +162,7 @@ zend_object_value _http_querystring_object_new_ex(zend_class_entry *ce, http_que
        }
 
        ALLOC_HASHTABLE(OBJ_PROP(o));
-       zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
 
        ov.handle = putObject(http_querystring_object, o);
index 047e2a34c13cda697627693b43636e017bd37bbc..bc7a0f854e1107fd361fd67fd7f501ca8bd14aa3 100644 (file)
@@ -409,7 +409,7 @@ zend_object_value _http_request_object_new_ex(zend_class_entry *ce, CURL *ch, ht
        }
 
        ALLOC_HASHTABLE(OBJ_PROP(o));
-       zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
 
        ov.handle = putObject(http_request_object, o);
index c49edc559f7c35ce4dee6073f52cf963d8dc9204..4ca9de76725fdc877279c8aac222e4a065dacc2d 100644 (file)
@@ -121,7 +121,7 @@ zend_object_value _http_requestpool_object_new(zend_class_entry *ce TSRMLS_DC)
        http_request_pool_init(&o->pool);
 
        ALLOC_HASHTABLE(OBJ_PROP(o));
-       zend_hash_init(OBJ_PROP(o), 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
        zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
 
        ov.handle = putObject(http_requestpool_object, o);