From: Michael Wallner Date: Wed, 29 Mar 2006 12:38:01 +0000 (+0000) Subject: - allocate known count of HashTables entries on init X-Git-Tag: RELEASE_1_0_0RC3~23 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5b8614c1c854c6683af7bf2dca4a6c970d4bfc25;p=m6w6%2Fext-http - allocate known count of HashTables entries on init --- diff --git a/http_querystring_object.c b/http_querystring_object.c index 55d355d..70c68cf 100644 --- a/http_querystring_object.c +++ b/http_querystring_object.c @@ -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); diff --git a/http_request_object.c b/http_request_object.c index 047e2a3..bc7a0f8 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -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); diff --git a/http_requestpool_object.c b/http_requestpool_object.c index c49edc5..4ca9de7 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -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);