cvs: /php4 main.c php_variables.c

From: Date: Sun, 13 Feb 2000 13:25:32 +0000
Subject: cvs: /php4 main.c php_variables.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-10213@lists.php.net to get a copy of this message
andi Sun Feb 13 05:25:32 2000 EDT Modified files: /php4 main.c php_variables.c Log: - Improve startup speed a bit by using the hash_*_ptr() functions Index: php4/main.c diff -u php4/main.c:1.205 php4/main.c:1.206 --- php4/main.c:1.205 Sat Feb 12 16:26:53 2000 +++ php4/main.c Sun Feb 13 05:25:01 2000 @@ -19,7 +19,7 @@ */ -/* $Id: main.c,v 1.205 2000/02/13 00:26:53 zeev Exp $ */ +/* $Id: main.c,v 1.206 2000/02/13 13:25:01 andi Exp $ */ #include <stdio.h> @@ -922,7 +922,7 @@ ALLOC_ZVAL(array_ptr); array_init(array_ptr); INIT_PZVAL(array_ptr); - zend_hash_add(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &array_ptr, sizeof(pval *),NULL); + zend_hash_add_ptr(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), array_ptr, sizeof(pval *),NULL); } /* Server variables */ @@ -1053,8 +1053,8 @@ INIT_PZVAL(argc); if (PG(register_globals)) { - zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(pval *), NULL); - zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(pval *), NULL); + zend_hash_update_ptr(&EG(symbol_table), "argv", sizeof("argv"), arr, sizeof(pval *), NULL); + zend_hash_add_ptr(&EG(symbol_table), "argc", sizeof("argc"), argc, sizeof(pval *), NULL); } if (PG(track_vars)) { @@ -1062,8 +1062,8 @@ arr->refcount++; argc->refcount++; } - zend_hash_update(track_vars_array->value.ht, "argv", sizeof("argv"), &arr, sizeof(pval *), NULL); - zend_hash_update(track_vars_array->value.ht, "argc", sizeof("argc"), &argc, sizeof(pval *), NULL); + zend_hash_update_ptr(track_vars_array->value.ht, "argv", sizeof("argv"), arr, sizeof(pval *), NULL); + zend_hash_update_ptr(track_vars_array->value.ht, "argc", sizeof("argc"), argc, sizeof(pval *), NULL); } } Index: php4/php_variables.c diff -u php4/php_variables.c:1.3 php4/php_variables.c:1.4 --- php4/php_variables.c:1.3 Sat Jan 29 03:55:43 2000 +++ php4/php_variables.c Sun Feb 13 05:25:01 2000 @@ -156,7 +156,7 @@ if (!index) { zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); } else { - zend_hash_update(symtable1, index, index_len+1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); + zend_hash_update_ptr(symtable1, index, index_len+1, gpc_element, sizeof(zval *), (void **) &gpc_element_p); } if (!top_gpc_p) { top_gpc_p = gpc_element_p; @@ -168,7 +168,7 @@ if (top_gpc_p) { (*top_gpc_p)->is_ref = 1; if (symtable2) { - zend_hash_update(symtable2, var, var_len+1, top_gpc_p, sizeof(zval *), NULL); + zend_hash_update_ptr(symtable2, var, var_len+1, *top_gpc_p, sizeof(zval *), NULL); (*top_gpc_p)->refcount++; } } @@ -192,13 +192,13 @@ INIT_PZVAL(array_ptr); switch (arg) { case PARSE_POST: - zend_hash_add(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), &array_ptr, sizeof(pval *),NULL); + zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), array_ptr, sizeof(pval *),NULL); break; case PARSE_GET: - zend_hash_add(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), &array_ptr, sizeof(pval *),NULL); + zend_hash_add_ptr(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), array_ptr, sizeof(pval *),NULL); break; case PARSE_COOKIE: - zend_hash_add(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), &array_ptr, sizeof(pval *),NULL); + zend_hash_add_ptr(&EG(symbol_table), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), array_ptr, sizeof(pval *),NULL); break; } } else { @@ -294,7 +294,7 @@ ALLOC_ZVAL(array_ptr); array_init(array_ptr); INIT_PZVAL(array_ptr); - zend_hash_add(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), &array_ptr, sizeof(pval *),NULL); + zend_hash_add_ptr(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), array_ptr, sizeof(pval *),NULL); } for (env = environ; env != NULL && *env != NULL; env++) {

« previous php.version4 (#10213) next »