summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/SAPI.c2
-rw-r--r--main/output.c8
-rw-r--r--main/php_ini.c8
-rw-r--r--main/rfc1867.c4
-rw-r--r--main/streams/streams.c13
5 files changed, 15 insertions, 20 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 2b8b1826da..9cacbd4b4b 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -65,7 +65,7 @@ static void _type_dtor(zval *zv)
static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC)
{
memset(sapi_globals, 0, sizeof(*sapi_globals));
- zend_hash_init_ex(&sapi_globals->known_post_content_types, 5, NULL, _type_dtor, 1, 0);
+ zend_hash_init_ex(&sapi_globals->known_post_content_types, 8, NULL, _type_dtor, 1, 0);
php_setup_sapi_content_types(TSRMLS_C);
}
diff --git a/main/output.c b/main/output.c
index 13cea0a8f8..cbf1fed9f0 100644
--- a/main/output.c
+++ b/main/output.c
@@ -137,9 +137,9 @@ static void reverse_conflict_dtor(zval *zv)
PHPAPI void php_output_startup(void)
{
ZEND_INIT_MODULE_GLOBALS(output, php_output_init_globals, NULL);
- zend_hash_init(&php_output_handler_aliases, 0, NULL, NULL, 1);
- zend_hash_init(&php_output_handler_conflicts, 0, NULL, NULL, 1);
- zend_hash_init(&php_output_handler_reverse_conflicts, 0, NULL, reverse_conflict_dtor, 1);
+ zend_hash_init(&php_output_handler_aliases, 8, NULL, NULL, 1);
+ zend_hash_init(&php_output_handler_conflicts, 8, NULL, NULL, 1);
+ zend_hash_init(&php_output_handler_reverse_conflicts, 8, NULL, reverse_conflict_dtor, 1);
php_output_direct = php_output_stdout;
}
/* }}} */
@@ -636,7 +636,7 @@ PHPAPI int php_output_handler_reverse_conflict_register(const char *name, size_t
if (SUCCESS == (rev_ptr = zend_hash_str_find_ptr(&php_output_handler_reverse_conflicts, name, name_len))) {
return zend_hash_next_index_insert_ptr(rev_ptr, check_func) ? SUCCESS : FAILURE;
} else {
- zend_hash_init(&rev, 1, NULL, NULL, 1);
+ zend_hash_init(&rev, 8, NULL, NULL, 1);
if (SUCCESS != zend_hash_next_index_insert_ptr(&rev, check_func)) {
zend_hash_destroy(&rev);
return FAILURE;
diff --git a/main/php_ini.c b/main/php_ini.c
index 024dbe6821..ed7da808f7 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -262,7 +262,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
/* If option not found in hash or is not an array -> create array, otherwise add to existing array */
if ((find_arr = zend_hash_find(active_hash, Z_STR_P(arg1))) == NULL || Z_TYPE_P(find_arr) != IS_ARRAY) {
ZVAL_NEW_PERSISTENT_ARR(&option_arr);
- zend_hash_init(Z_ARRVAL(option_arr), 0, NULL, (dtor_func_t) config_zval_dtor, 1);
+ zend_hash_init(Z_ARRVAL(option_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1);
find_arr = zend_hash_update(active_hash, Z_STR_P(arg1), &option_arr);
}
@@ -329,7 +329,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_t
zval section_arr;
ZVAL_NEW_PERSISTENT_ARR(&section_arr);
- zend_hash_init(Z_ARRVAL(section_arr), 0, NULL, (dtor_func_t) config_zval_dtor, 1);
+ zend_hash_init(Z_ARRVAL(section_arr), 8, NULL, (dtor_func_t) config_zval_dtor, 1);
entry = zend_hash_str_update(target_hash, key, key_len, &section_arr);
}
active_ini_hash = Z_ARRVAL_P(entry);
@@ -385,9 +385,7 @@ int php_init_config(TSRMLS_D)
int free_ini_search_path = 0;
zend_file_handle fh;
- if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) config_zval_dtor, 1) == FAILURE) {
- return FAILURE;
- }
+ zend_hash_init(&configuration_hash, 8, NULL, (dtor_func_t) config_zval_dtor, 1);
if (sapi_module.ini_defaults) {
sapi_module.ini_defaults(&configuration_hash);
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 5acebd5b5b..98a29f1e39 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -762,10 +762,10 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
/* Initialize $_FILES[] */
- zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0);
+ zend_hash_init(&PG(rfc1867_protected_variables), 8, NULL, NULL, 0);
ALLOC_HASHTABLE(uploaded_files);
- zend_hash_init(uploaded_files, 5, NULL, free_filename, 0);
+ zend_hash_init(uploaded_files, 8, NULL, free_filename, 0);
SG(rfc1867_uploaded_files) = uploaded_files;
array_init(&PG(http_globals)[TRACK_VARS_FILES]);
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 553404dc3c..7ab74c7c08 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1648,14 +1648,11 @@ int php_init_stream_wrappers(int module_number TSRMLS_DC)
/* Filters are cleaned up by the streams they're attached to */
le_stream_filter = zend_register_list_destructors_ex(NULL, NULL, "stream filter", module_number);
- return (
- zend_hash_init(&url_stream_wrappers_hash, 0, NULL, NULL, 1) == SUCCESS
- &&
- zend_hash_init(php_get_stream_filters_hash_global(), 0, NULL, NULL, 1) == SUCCESS
- &&
- zend_hash_init(php_stream_xport_get_hash(), 0, NULL, NULL, 1) == SUCCESS
- &&
- php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
+ zend_hash_init(&url_stream_wrappers_hash, 8, NULL, NULL, 1);
+ zend_hash_init(php_get_stream_filters_hash_global(), 8, NULL, NULL, 1);
+ zend_hash_init(php_stream_xport_get_hash(), 8, NULL, NULL, 1);
+
+ return (php_stream_xport_register("tcp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
&&
php_stream_xport_register("udp", php_stream_generic_socket_factory TSRMLS_CC) == SUCCESS
#if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__) || defined(NETWARE))