[PHP-CVS] svn: /php/php-src/trunk/sapi/fpm/fpm/ fpm_conf.c
fat Thu, 22 Apr 2010 07:14:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298298 Log: correct wrong comparison (thx to felipe) Changed paths: U php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c === --- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c 2010-04-22 06:15:46 UTC (rev 298297) +++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c 2010-04-22 07:14:06 UTC (rev 298298) @@ -418,7 +418,7 @@ return -1; } - if (wp-config-pm == NULL) { + if (wp-config-pm != PM_STYLE_STATIC wp-config-pm != PM_STYLE_DYNAMIC) { zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] the process manager is missing (static or dynamic), wp-config-name); return -1; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c
On 22.04.2010 02:04, Kalle Sommer Nielsen wrote: kalleWed, 21 Apr 2010 22:04:19 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298275 Log: Added missing zend_parse_parameters_none() call to sys_getloadavg() Please don't forget to fix the tests as well. -- Wbr, Antony Dovgal --- http://pinba.org - realtime statistics for PHP -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/tests/unset_cv07.phpt ext/standard/basic_functions.c ext/standard/basic_functions.h ext/standard/tests/general_functions/import_request.phpt ext/standa
On 22.04.2010 02:23, Kalle Sommer Nielsen wrote: +--SKIPIF-- +?php if(PHP_VERSION_ID 503099){ die('Not needed anymore without register_globals'); } ? First 4 letters of this message must be 'skip', otherwise the test is not skipped. -- Wbr, Antony Dovgal --- http://pinba.org - realtime statistics for PHP -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/curl/interface.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/curl/interface.c trunk/ext/curl/interface.c
On 22.04.2010 12:58, Pierre Joye wrote: pajoye Thu, 22 Apr 2010 08:58:07 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298299 Log: - Bug #51629, CURLOPT_FOLLOWLOCATION error message is misleading Bug: http://bugs.php.net/51629 (Open) CURLOPT_FOLLOWLOCATION error message is misleading Did you fix the test? -- Wbr, Antony Dovgal --- http://pinba.org - realtime statistics for PHP -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt branches/PHP_5_2/ext/curl/tests/curl_setopt_basic001.phpt branches/PHP_5_3/ext/curl/te
pajoye Thu, 22 Apr 2010 11:49:10 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298313 Log: - Bug #51629, CURLOPT_FOLLOWLOCATION error message is misleading Bug: http://bugs.php.net/51629 (Closed) CURLOPT_FOLLOWLOCATION error message is misleading Changed paths: U php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt U php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_basic001.phpt U php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt U php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_basic001.phpt U php/php-src/trunk/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt U php/php-src/trunk/ext/curl/tests/curl_setopt_basic001.phpt Modified: php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt === --- php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:31:12 UTC (rev 298312) +++ php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:49:10 UTC (rev 298313) @@ -17,6 +17,6 @@ var_dump($succes); ? --EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(in safe_mode or an )?%ropen_basedir is set in %s.php on line %d +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(safe_mode is enabled or an )?%ropen_basedir is set in %s.php on line %d bool(false) Modified: php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_basic001.phpt === --- php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_basic001.phpt 2010-04-22 11:31:12 UTC (rev 298312) +++ php/php-src/branches/PHP_5_2/ext/curl/tests/curl_setopt_basic001.phpt 2010-04-22 11:49:10 UTC (rev 298313) @@ -30,6 +30,6 @@ --EXPECTF-- *** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in %s on line %d +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in %s on line %d bool(false) ===DONE=== Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt === --- php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:31:12 UTC (rev 298312) +++ php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:49:10 UTC (rev 298313) @@ -17,6 +17,6 @@ var_dump($succes); ? --EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(in safe_mode or an )?%ropen_basedir is set in %s.php on line %d +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(safe_mode is enabled or an )?%ropen_basedir is set in %s.php on line %d bool(false) Modified: php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_basic001.phpt === --- php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_basic001.phpt 2010-04-22 11:31:12 UTC (rev 298312) +++ php/php-src/branches/PHP_5_3/ext/curl/tests/curl_setopt_basic001.phpt 2010-04-22 11:49:10 UTC (rev 298313) @@ -30,6 +30,6 @@ Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 *** Testing curl_setopt with CURLOPT_FOLLOWLOCATION in safemode -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in %s on line %d +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in %s on line %d bool(false) Modified: php/php-src/trunk/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt === --- php/php-src/trunk/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:31:12 UTC (rev 298312) +++ php/php-src/trunk/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt 2010-04-22 11:49:10 UTC (rev 298313) @@ -17,6 +17,6 @@ var_dump($succes); ? --EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(in safe_mode or an )?%ropen_basedir is set in %s.php on line %d +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when %r(safe_mode is enabled or an )?%ropen_basedir is set in %s.php on line %d bool(false) Modified: php/php-src/trunk/ext/curl/tests/curl_setopt_basic001.phpt
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
tony2001 Thu, 22 Apr 2010 11:56:08 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298314 Log: initialize variable. this code still segfaults in OpenSSL, no idea why Changed paths: U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2010-04-22 11:49:10 UTC (rev 298313) +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2010-04-22 11:56:08 UTC (rev 298314) @@ -4445,7 +4445,7 @@ EVP_PKEY *key = NULL; SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; - const char * private_key; + const char * private_key = NULL; if (VCWD_REALPATH(certfile, resolved_path_buff)) { /* a certificate to use for authentication */ Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 11:49:10 UTC (rev 298313) +++ php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 11:56:08 UTC (rev 298314) @@ -4443,7 +4443,7 @@ EVP_PKEY *key = NULL; SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; - const char * private_key; + const char * private_key = NULL; if (VCWD_REALPATH(certfile, resolved_path_buff)) { /* a certificate to use for authentication */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_compile.c Zend/zend_vm_def.h Zend/zend_vm_execute.h Zend/zend_vm_opcodes.h
dmitry Thu, 22 Apr 2010 11:56:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298315 Log: ZEND_RETURN is splitted into two new instructions ZEND_RETURN and ZEND_RETURN_BY_REF Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/Zend/zend_compile.c U php/php-src/trunk/Zend/zend_vm_def.h U php/php-src/trunk/Zend/zend_vm_execute.h U php/php-src/trunk/Zend/zend_vm_opcodes.h Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-04-22 11:56:08 UTC (rev 298314) +++ php/php-src/trunk/NEWS 2010-04-22 11:56:45 UTC (rev 298315) @@ -8,6 +8,8 @@ . ZEND_RECV now always has IS_CV as its result . ZEND_CATCH now has to be used only with constant class names . ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order + . ZEND_RETURN is splitted into two new instructions ZEND_RETURN and +ZEND_RETURN_BY_REF - Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. (Dmitry) - Added an optimization which saves memory and emalloc/efree calls for empty Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-22 11:56:08 UTC (rev 298314) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-22 11:56:45 UTC (rev 298315) @@ -2439,7 +2439,7 @@ opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline-opcode = ZEND_RETURN; + opline-opcode = (CG(active_op_array)-return_reference == ZEND_RETURN_REF) ? ZEND_RETURN_BY_REF : ZEND_RETURN; if (expr) { SET_NODE(opline-op1, expr); Modified: php/php-src/trunk/Zend/zend_vm_def.h === --- php/php-src/trunk/Zend/zend_vm_def.h 2010-04-22 11:56:08 UTC (rev 298314) +++ php/php-src/trunk/Zend/zend_vm_def.h 2010-04-22 11:56:45 UTC (rev 298315) @@ -2708,16 +2708,73 @@ { USE_OPLINE zval *retval_ptr; + zend_free_op free_op1; + + SAVE_OPLINE(); + retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + + if (!EG(return_value_ptr_ptr)) { + if (OP1_TYPE == IS_TMP_VAR) { + FREE_OP1(); + } + } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */ + if (OP1_TYPE == IS_CONST || + (PZVAL_IS_REF(retval_ptr) Z_REFCOUNT_P(retval_ptr) 0)) { + zval *ret; + + ALLOC_ZVAL(ret); + INIT_PZVAL_COPY(ret, retval_ptr); + zval_copy_ctor(ret); + *EG(return_value_ptr_ptr) = ret; + } else { + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); + } + } else { + zval *ret; + + ALLOC_ZVAL(ret); + INIT_PZVAL_COPY(ret, retval_ptr); + *EG(return_value_ptr_ptr) = ret; + } + FREE_OP1_IF_VAR(); + ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); +} + +ZEND_VM_HANDLER(111, ZEND_RETURN_BY_REF, CONST|TMP|VAR|CV, ANY) +{ + USE_OPLINE + zval *retval_ptr; zval **retval_ptr_ptr; zend_free_op free_op1; SAVE_OPLINE(); - if (UNEXPECTED(EG(active_op_array)-return_reference == ZEND_RETURN_REF)) { + do { if (OP1_TYPE == IS_CONST || OP1_TYPE == IS_TMP_VAR) { /* Not supposed to happen, but we'll allow it */ zend_error(E_NOTICE, Only variable references should be returned by reference); - ZEND_VM_C_GOTO(return_by_value); + + retval_ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); + if (!EG(return_value_ptr_ptr)) { +if (OP1_TYPE == IS_TMP_VAR) { + FREE_OP1(); +} + } else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */ +zval *ret; + +ALLOC_ZVAL(ret); +INIT_PZVAL_COPY(ret, retval_ptr); +zval_copy_ctor(ret); +*EG(return_value_ptr_ptr) = ret; + } else { +zval *ret; + +ALLOC_ZVAL(ret); +INIT_PZVAL_COPY(ret, retval_ptr); +*EG(return_value_ptr_ptr) = ret; + } + break; } retval_ptr_ptr = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); @@ -2730,11 +2787,13 @@ if (opline-extended_value == ZEND_RETURNS_FUNCTION EX_T(opline-op1.var).var.fcall_returned_reference) { } else if (EX_T(opline-op1.var).var.ptr_ptr == EX_T(opline-op1.var).var.ptr) { -if (OP1_TYPE == IS_VAR !OP1_FREE) { - PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */ +zend_error(E_NOTICE, Only variable references should be returned by reference); +if (EG(return_value_ptr_ptr)) { + retval_ptr = *retval_ptr_ptr; + *EG(return_value_ptr_ptr) = retval_ptr; + Z_ADDREF_P(retval_ptr); } -zend_error(E_NOTICE, Only variable references should be returned by reference); -ZEND_VM_C_GOTO(return_by_value); +break; } } @@ -2742,43 +2801,12 @@ SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr); Z_ADDREF_PP(retval_ptr_ptr); - (*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr); + *EG(return_value_ptr_ptr) = *retval_ptr_ptr; } - FREE_OP1_IF_VAR(); - ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper); - } else { -ZEND_VM_C_LABEL(return_by_value): + } while (0); - retval_ptr =
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.h trunk/ext/mysqlnd/mysqlnd_statistics.h
andrey Thu, 22 Apr 2010 13:03:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298318 Log: Add the posibility to switch off the compilation of statistics collection, for those who want to optimize the last percent of their binaries. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.h 2010-04-22 12:43:37 UTC (rev 298317) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.h 2010-04-22 13:03:44 UTC (rev 298318) @@ -42,21 +42,28 @@ #define MYSQLND_STATS_UNLOCK(stats) #endif +#ifndef MYSQLND_CORE_STATISTICS_TRIGGERS_DISABLED +#define MYSQLND_STAT_CALL_TRIGGER(s_array, statistic, val) \ + if ((s_array)-triggers[(statistic)] (s_array)-in_trigger == FALSE) { \ + (s_array)-in_trigger = TRUE; \ + MYSQLND_STATS_UNLOCK((s_array)); \ + \ + (s_array)-triggers[(statistic)]((s_array), (statistic), (val) TSRMLS_CC); \ + \ + MYSQLND_STATS_LOCK((s_array)); \ + (s_array)-in_trigger = FALSE; \ + } +#else +#define MYSQLND_STAT_CALL_TRIGGER(s_array, statistic, val) +#endif /* MYSQLND_CORE_STATISTICS_TRIGGERS_DISABLED */ + #define MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(stats, statistic, value) \ { \ MYSQLND_STATS_LOCK(stats); \ (stats)-values[(statistic)] += (value); \ - if ((stats)-triggers[(statistic)] (stats)-in_trigger == FALSE) { \ - (stats)-in_trigger = TRUE; \ - MYSQLND_STATS_UNLOCK(stats); \ - \ - (stats)-triggers[(statistic)]((stats), (statistic), (value) TSRMLS_CC); \ - \ - MYSQLND_STATS_LOCK(stats); \ - (stats)-in_trigger = FALSE; \ - } \ + MYSQLND_STAT_CALL_TRIGGER((stats), (statistic), (value)); \ MYSQLND_STATS_UNLOCK(_p_s); \ - } \ + } #define MYSQLND_DEC_STATISTIC(enabler, stats, statistic) \ { \ @@ -116,6 +123,9 @@ } + +#ifndef MYSQLND_CORE_STATISTICS_DISABLED + #define MYSQLND_INC_GLOBAL_STATISTIC(statistic) \ MYSQLND_INC_STATISTIC(MYSQLND_G(collect_statistics), mysqlnd_global_stats, (statistic)) @@ -141,7 +151,18 @@ MYSQLND_INC_STATISTIC_W_VALUE3(MYSQLND_G(collect_statistics), mysqlnd_global_stats, (statistic1), (value1), (statistic2), (value2), (statistic3), (value3)); \ MYSQLND_INC_STATISTIC_W_VALUE3(MYSQLND_G(collect_statistics), (conn_stats), (statistic1), (value1), (statistic2), (value2), (statistic3), (value3)); +#else +#define MYSQLND_INC_GLOBAL_STATISTIC(statistic) +#define MYSQLND_DEC_CONN_STATISTIC(conn_stats, statistic) +#define MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(statistic1, value1, statistic2, value2) +#define MYSQLND_INC_CONN_STATISTIC(conn_stats, statistic) +#define MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn_stats, statistic, value) +#define MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn_stats, statistic1, value1, statistic2, value2) +#define MYSQLND_INC_CONN_STATISTIC_W_VALUE3(conn_stats, statistic1, value1, statistic2, value2, statistic3, value3) + +#endif /* MYSQLND_CORE_STATISTICS_DISABLED */ + PHPAPI void mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING * names, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC); PHPAPI void mysqlnd_stats_init(MYSQLND_STATS ** stats, size_t statistic_count); Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.h 2010-04-22 12:43:37 UTC (rev 298317) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.h 2010-04-22 13:03:44 UTC (rev 298318) @@ -42,21 +42,28 @@ #define
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_vm_def.h zend_vm_execute.h
felipe Thu, 22 Apr 2010 13:28:53 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298319 Log: - Removed unused variables Changed paths: U php/php-src/trunk/Zend/zend_vm_def.h U php/php-src/trunk/Zend/zend_vm_execute.h Modified: php/php-src/trunk/Zend/zend_vm_def.h === --- php/php-src/trunk/Zend/zend_vm_def.h2010-04-22 13:03:44 UTC (rev 298318) +++ php/php-src/trunk/Zend/zend_vm_def.h2010-04-22 13:28:53 UTC (rev 298319) @@ -339,7 +339,6 @@ zval *object; zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R); zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (OP1_TYPE == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -4500,8 +4499,6 @@ ZEND_VM_HANDLER(101, ZEND_EXT_STMT, ANY, ANY) { - USE_OPLINE - SAVE_OPLINE(); if (!EG(no_extensions)) { zend_llist_apply_with_argument(zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); @@ -4512,8 +4509,6 @@ ZEND_VM_HANDLER(102, ZEND_EXT_FCALL_BEGIN, ANY, ANY) { - USE_OPLINE - SAVE_OPLINE(); if (!EG(no_extensions)) { zend_llist_apply_with_argument(zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); Modified: php/php-src/trunk/Zend/zend_vm_execute.h === --- php/php-src/trunk/Zend/zend_vm_execute.h2010-04-22 13:03:44 UTC (rev 298318) +++ php/php-src/trunk/Zend/zend_vm_execute.h2010-04-22 13:28:53 UTC (rev 298319) @@ -583,8 +583,6 @@ static int ZEND_FASTCALL ZEND_EXT_STMT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - USE_OPLINE - SAVE_OPLINE(); if (!EG(no_extensions)) { zend_llist_apply_with_argument(zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, EX(op_array) TSRMLS_CC); @@ -595,8 +593,6 @@ static int ZEND_FASTCALL ZEND_EXT_FCALL_BEGIN_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { - USE_OPLINE - SAVE_OPLINE(); if (!EG(no_extensions)) { zend_llist_apply_with_argument(zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, EX(op_array) TSRMLS_CC); @@ -10245,7 +10241,6 @@ zval *object; zval *property = opline-op2.zv; zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_VAR == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -12225,7 +12220,6 @@ zval *object; zval *property = _get_zval_ptr_tmp(opline-op2.var, EX_Ts(), free_op2 TSRMLS_CC); zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_VAR == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -14150,7 +14144,6 @@ zval *object; zval *property = _get_zval_ptr_var(opline-op2.var, EX_Ts(), free_op2 TSRMLS_CC); zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_VAR == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -15850,7 +15843,6 @@ zval *object; zval *property = NULL; zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_VAR == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -16751,7 +16743,6 @@ zval *object; zval *property = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline-op2.var TSRMLS_CC); zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_VAR == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -18531,7 +18522,6 @@ zval *object; zval *property = opline-op2.zv; zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_UNUSED == IS_VAR UNEXPECTED(object_ptr == NULL)) { @@ -19748,7 +19738,6 @@ zval *object; zval *property = _get_zval_ptr_tmp(opline-op2.var, EX_Ts(), free_op2 TSRMLS_CC); zval *value = get_zval_ptr((opline+1)-op1_type, (opline+1)-op1, EX_Ts(), free_op_data1, BP_VAR_R); - znode_op *result = opline-result; int have_get_ptr = 0; if (IS_UNUSED == IS_VAR
[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/micro_bench.php Zend/zend.h Zend/zend_compile.c Zend/zend_constants.c Zend/zend_constants.h Zend/zend_vm_def.h Zend/zend_vm_execute.h
dmitry Thu, 22 Apr 2010 15:03:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298322 Log: Optimized access to global constants using values with pre-calculated hash_values from litersls table Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/Zend/micro_bench.php U php/php-src/trunk/Zend/zend.h U php/php-src/trunk/Zend/zend_compile.c U php/php-src/trunk/Zend/zend_constants.c U php/php-src/trunk/Zend/zend_constants.h U php/php-src/trunk/Zend/zend_vm_def.h U php/php-src/trunk/Zend/zend_vm_execute.h Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-04-22 14:24:49 UTC (rev 298321) +++ php/php-src/trunk/NEWS 2010-04-22 15:03:17 UTC (rev 298322) @@ -10,6 +10,8 @@ . ZEND_FETCH_DIM_? may fetch array and dimension operans in a different order . ZEND_RETURN is splitted into two new instructions ZEND_RETURN and ZEND_RETURN_BY_REF + . optimized access to global constants using values with pre-calculated +hash_values from litersls table - Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. (Dmitry) - Added an optimization which saves memory and emalloc/efree calls for empty Modified: php/php-src/trunk/Zend/micro_bench.php === --- php/php-src/trunk/Zend/micro_bench.php 2010-04-22 14:24:49 UTC (rev 298321) +++ php/php-src/trunk/Zend/micro_bench.php 2010-04-22 15:03:17 UTC (rev 298322) @@ -166,6 +166,14 @@ } } +define('TEST', null); + +function read_const($n) { + for ($i = 0; $i $n; ++$i) { + $x = TEST; + } +} + /*/ function empty_loop($n) { @@ -272,4 +280,6 @@ $t = end_test($t, '$x = Foo::TEST', $overhead); create_object(N); $t = end_test($t, 'new Foo()', $overhead); +read_const(N); +$t = end_test($t, '$x = TEST', $overhead); total($t0, Total); Modified: php/php-src/trunk/Zend/zend.h === --- php/php-src/trunk/Zend/zend.h 2010-04-22 14:24:49 UTC (rev 298321) +++ php/php-src/trunk/Zend/zend.h 2010-04-22 15:03:17 UTC (rev 298322) @@ -525,11 +525,12 @@ #define IS_CONSTANT_ARRAY 9 /* Ugly hack to support constants as static array indices */ -#define IS_CONSTANT_TYPE_MASK 0x0f -#define IS_CONSTANT_UNQUALIFIED 0x10 -#define IS_CONSTANT_INDEX 0x80 -#define IS_LEXICAL_VAR 0x20 -#define IS_LEXICAL_REF 0x40 +#define IS_CONSTANT_TYPE_MASK 0x00f +#define IS_CONSTANT_UNQUALIFIED 0x010 +#define IS_CONSTANT_INDEX 0x080 +#define IS_LEXICAL_VAR0x020 +#define IS_LEXICAL_REF0x040 +#define IS_CONSTANT_IN_NAMESPACE 0x100 /* overloaded elements data types */ #define OE_IS_ARRAY (10) Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-22 14:24:49 UTC (rev 298321) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-22 15:03:17 UTC (rev 298322) @@ -420,6 +420,76 @@ } /* }}} */ +int zend_add_const_name_literal(zend_op_array *op_array, const zval *zv, int unqualified TSRMLS_DC) /* {{{ */ +{ + int ret, tmp_literal; + char *name, *tmp_name, *ns_separator; + int name_len, ns_len; + zval c; + + if (op_array-last_literal 0 + op_array-literals[op_array-last_literal - 1].constant == zv) { + /* we already have function name as last literal (do nothing) */ + ret = op_array-last_literal - 1; + } else { + ret = zend_add_literal(op_array, zv); + } + + /* skip leading '\\' */ + if (Z_STRVAL_P(zv)[0] == '\\') { + name_len = Z_STRLEN_P(zv) - 1; + name = Z_STRVAL_P(zv) + 1; + } else { + name_len = Z_STRLEN_P(zv); + name = Z_STRVAL_P(zv); + } + ns_separator = zend_memrchr(name, '\\', name_len); + if (ns_separator) { + ns_len = ns_separator - name; + } else { + ns_len = 0; + } + + if (ns_len) { + /* lowercased namespace name original constant name */ + tmp_name = estrndup(name, name_len); + zend_str_tolower(tmp_name, ns_len); + ZVAL_STRINGL(c, tmp_name, name_len, 0); + tmp_literal = zend_add_literal(CG(active_op_array), c); + CALCULATE_LITERAL_HASH(tmp_literal); + + /* lowercased namespace name lowercased constant name */ + tmp_name = zend_str_tolower_dup(name, name_len); + ZVAL_STRINGL(c, tmp_name, name_len, 0); + tmp_literal = zend_add_literal(CG(active_op_array), c); + CALCULATE_LITERAL_HASH(tmp_literal); + } + + if (ns_len) { + if (!unqualified) { + return ret; + } + ns_len++; + name += ns_len; + name_len -= ns_len; + } + + /* original constant name */ + tmp_name = estrndup(name, name_len); + ZVAL_STRINGL(c, tmp_name, name_len, 0); + tmp_literal = zend_add_literal(CG(active_op_array), c); + CALCULATE_LITERAL_HASH(tmp_literal); + + /* lowercased constant name */ + tmp_name = zend_str_tolower_dup(name, name_len); + ZVAL_STRINGL(c, tmp_name, name_len, 0); +
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd.h branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_re
andrey Thu, 22 Apr 2010 15:07:40 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298323 Log: Remove dead code and add possibility to fine tune the size of a mempool (used for result sets). Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h U php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c U php/php-src/trunk/ext/mysqlnd/mysqlnd.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_block_alloc.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h U php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h 2010-04-22 15:03:17 UTC (rev 298322) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.h 2010-04-22 15:07:40 UTC (rev 298323) @@ -277,6 +277,7 @@ long net_read_buffer_size; long log_mask; long net_read_timeout; + long mempool_default_size; ZEND_END_MODULE_GLOBALS(mysqlnd) ZEND_EXTERN_MODULE_GLOBALS(mysqlnd); Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c 2010-04-22 15:03:17 UTC (rev 298322) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_block_alloc.c 2010-04-22 15:07:40 UTC (rev 298323) @@ -29,22 +29,6 @@ /* {{{ mysqlnd_mempool_free_chunk */ static void -mysqlnd_mempool_free_contents(MYSQLND_MEMORY_POOL * pool TSRMLS_DC) -{ - unsigned int i; - DBG_ENTER(mysqlnd_mempool_dtor); - for (i = 0; i pool-free_chunk_list_elements; i++) { - MYSQLND_MEMORY_POOL_CHUNK * chunk = pool-free_chunk_list[i]; - chunk-free_chunk(chunk, FALSE TSRMLS_CC); - } - - DBG_VOID_RETURN; -} -/* }}} */ - - -/* {{{ mysqlnd_mempool_free_chunk */ -static void mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, zend_bool cache_it TSRMLS_DC) { MYSQLND_MEMORY_POOL * pool = chunk-pool; @@ -62,13 +46,7 @@ } else { mnd_free(chunk-ptr); } - if (cache_it pool-free_chunk_list_elements MYSQLND_MEMORY_POOL_CHUNK_LIST_SIZE) { - chunk-ptr = NULL; - pool-free_chunk_list[pool-free_chunk_list_elements++] = chunk; - } else { - /* We did not cache it - free it */ - mnd_free(chunk); - } + mnd_free(chunk); DBG_VOID_RETURN; } /* }}} */ @@ -110,7 +88,7 @@ memcpy(new_ptr, chunk-ptr, chunk-size); chunk-ptr = new_ptr; chunk-size = size; -chunk-pool = NULL; /* now we have no pool memory */ +chunk-pool = NULL; /* now we have non-pool memory */ pool-refcount--; } } @@ -129,11 +107,7 @@ MYSQLND_MEMORY_POOL_CHUNK *chunk = NULL; DBG_ENTER(mysqlnd_mempool_get_chunk); - if (pool-free_chunk_list_elements) { - chunk = pool-free_chunk_list[--pool-free_chunk_list_elements]; - } else { - chunk = mnd_malloc(sizeof(MYSQLND_MEMORY_POOL_CHUNK)); - } + chunk = mnd_malloc(sizeof(MYSQLND_MEMORY_POOL_CHUNK)); chunk-free_chunk = mysqlnd_mempool_free_chunk; chunk-resize_chunk = mysqlnd_mempool_resize_chunk; @@ -167,7 +141,7 @@ MYSQLND_MEMORY_POOL * ret = mnd_calloc(1, sizeof(MYSQLND_MEMORY_POOL)); DBG_ENTER(mysqlnd_mempool_create); - ret-free_size = ret-arena_size = arena_size; + ret-free_size = ret-arena_size = arena_size ? arena_size : 0; ret-refcount = 0; /* OOM ? */ ret-arena = mnd_malloc(ret-arena_size); @@ -184,7 +158,6 @@ { DBG_ENTER(mysqlnd_mempool_destroy); /* mnd_free will reference LOCK_access and might crash, depending on the caller...*/ - mysqlnd_mempool_free_contents(pool TSRMLS_CC); mnd_free(pool-arena); mnd_free(pool); DBG_VOID_RETURN; Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c 2010-04-22 15:03:17 UTC (rev 298322) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c 2010-04-22 15:07:40 UTC (rev 298323) @@ -102,7 +102,7 @@ result-m.fetch_row = mysqlnd_fetch_stmt_row_buffered; result-m.fetch_lengths = NULL;/* makes no sense */ - result-result_set_memory_pool = mysqlnd_mempool_create(16000 TSRMLS_CC); + result-result_set_memory_pool = mysqlnd_mempool_create(MYSQLND_G(mempool_default_size) TSRMLS_CC); ret = result-m.store_result_fetch_data(conn, result, result-meta, TRUE, to_cache TSRMLS_CC); Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c trunk/ext/mysqlnd/php_mysqlnd.c
andrey Thu, 22 Apr 2010 15:14:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298324 Log: adding what last commit was missing Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c U php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c 2010-04-22 15:07:40 UTC (rev 298323) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c 2010-04-22 15:14:45 UTC (rev 298324) @@ -151,6 +151,7 @@ mysqlnd_globals-net_read_buffer_size = 32768; mysqlnd_globals-net_read_timeout = 31536000; mysqlnd_globals-log_mask = 0; + mysqlnd_globals-log_mask = 16000; } /* }}} */ Modified: php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c === --- php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-04-22 15:07:40 UTC (rev 298323) +++ php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-04-22 15:14:45 UTC (rev 298324) @@ -151,6 +151,7 @@ mysqlnd_globals-net_read_buffer_size = 32768; mysqlnd_globals-net_read_timeout = 31536000; mysqlnd_globals-log_mask = 0; + mysqlnd_globals-log_mask = 16000; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_execute.c
dmitry Thu, 22 Apr 2010 15:51:03 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298330 Log: Removed unused function Changed paths: U php/php-src/trunk/Zend/zend_execute.c Modified: php/php-src/trunk/Zend/zend_execute.c === --- php/php-src/trunk/Zend/zend_execute.c 2010-04-22 15:41:59 UTC (rev 298329) +++ php/php-src/trunk/Zend/zend_execute.c 2010-04-22 15:51:03 UTC (rev 298330) @@ -92,11 +92,6 @@ } } -static zend_never_inline void __zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) -{ - __zval_ptr_dtor(zval_ptr ZEND_FILE_LINE_RELAY_CC); -} - #undef zval_ptr_dtor #define zval_ptr_dtor(pzv) i_zval_ptr_dtor(*(pzv) ZEND_FILE_LINE_CC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
tony2001 Thu, 22 Apr 2010 15:59:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298331 Log: revert most of the Andrey's patch that causes segfaults (as agreed with Pierre) Changed paths: U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2010-04-22 15:51:03 UTC (rev 298330) +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2010-04-22 15:59:44 UTC (rev 298331) @@ -4445,7 +4445,6 @@ EVP_PKEY *key = NULL; SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; - const char * private_key = NULL; if (VCWD_REALPATH(certfile, resolved_path_buff)) { /* a certificate to use for authentication */ @@ -4454,10 +4453,8 @@ return NULL; } - GET_VER_OPT_STRING(local_pk, private_key); - - if (private_key SSL_CTX_use_PrivateKey_file(ctx, private_key, SSL_FILETYPE_PEM) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set private key file `%s', private_key); + if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set private key file `%s', resolved_path_buff); return NULL; } Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 15:51:03 UTC (rev 298330) +++ php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 15:59:44 UTC (rev 298331) @@ -4443,7 +4443,6 @@ EVP_PKEY *key = NULL; SSL *tmpssl; char resolved_path_buff[MAXPATHLEN]; - const char * private_key = NULL; if (VCWD_REALPATH(certfile, resolved_path_buff)) { /* a certificate to use for authentication */ @@ -4452,10 +4451,8 @@ return NULL; } - GET_VER_OPT_STRING(local_pk, private_key); - - if (private_key SSL_CTX_use_PrivateKey_file(ctx, private_key, SSL_FILETYPE_PEM) != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set private key file `%s', private_key); + if (SSL_CTX_use_PrivateKey_file(ctx, reso, SSL_FILETYPE_PEM) != 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set private key file `%s', resolved_path_buff); return NULL; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/openssl/ openssl.c
tony2001 Thu, 22 Apr 2010 16:00:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298332 Log: fix typo Changed paths: U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 15:59:44 UTC (rev 298331) +++ php/php-src/trunk/ext/openssl/openssl.c 2010-04-22 16:00:45 UTC (rev 298332) @@ -4451,7 +4451,7 @@ return NULL; } - if (SSL_CTX_use_PrivateKey_file(ctx, reso, SSL_FILETYPE_PEM) != 1) { + if (SSL_CTX_use_PrivateKey_file(ctx, resolved_path_buff, SSL_FILETYPE_PEM) != 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set private key file `%s', resolved_path_buff); return NULL; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c trunk/ext/mysqlnd/php_mysqlnd.c
andrey Thu, 22 Apr 2010 16:22:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298335 Log: Fix problem spotted by Felipe. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c U php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c 2010-04-22 16:20:08 UTC (rev 298334) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/php_mysqlnd.c 2010-04-22 16:22:56 UTC (rev 298335) @@ -151,7 +151,7 @@ mysqlnd_globals-net_read_buffer_size = 32768; mysqlnd_globals-net_read_timeout = 31536000; mysqlnd_globals-log_mask = 0; - mysqlnd_globals-log_mask = 16000; + mysqlnd_globals-mempool_default_size = 16000; } /* }}} */ Modified: php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c === --- php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-04-22 16:20:08 UTC (rev 298334) +++ php/php-src/trunk/ext/mysqlnd/php_mysqlnd.c 2010-04-22 16:22:56 UTC (rev 298335) @@ -151,7 +151,7 @@ mysqlnd_globals-net_read_buffer_size = 32768; mysqlnd_globals-net_read_timeout = 31536000; mysqlnd_globals-log_mask = 0; - mysqlnd_globals-log_mask = 16000; + mysqlnd_globals-mempool_default_size = 16000; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.c trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Thu, 22 Apr 2010 16:28:50 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298336 Log: Change the way the allocator is called - through an abstraction to give the possibility of pluggability. Thanks to the macros already used the changes are not pervasive. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.c U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c 2010-04-22 16:22:56 UTC (rev 298335) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.c 2010-04-22 16:28:50 UTC (rev 298336) @@ -28,7 +28,60 @@ #include mysqlnd_statistics.h #include zend_builtin_functions.h +static void * mysqlnd_zend_mm_emalloc(size_t size MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D); +static void mysqlnd_zend_mm_efree(void * ptr MYSQLND_MEM_D); +static void mysqlnd_zend_mm_pefree(void * ptr, zend_bool persistent MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_malloc(size_t size MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_calloc(unsigned int nmemb, size_t size MYSQLND_MEM_D); +static void * mysqlnd_zend_mm_realloc(void * ptr, size_t new_size MYSQLND_MEM_D); +static void mysqlnd_zend_mm_free(void * ptr MYSQLND_MEM_D); +static char * mysqlnd_zend_mm_pestrndup(const char * const ptr, size_t length, zend_bool persistent MYSQLND_MEM_D); +static char * mysqlnd_zend_mm_pestrdup(const char * const ptr, zend_bool persistent MYSQLND_MEM_D); +#define MYSQLND_DEBUG_MEMORY 1 + +struct st_mysqlnd_allocator_methods mysqlnd_allocator = +{ +#if MYSQLND_DEBUG_MEMORY + _mysqlnd_emalloc, + _mysqlnd_pemalloc, + _mysqlnd_ecalloc, + _mysqlnd_pecalloc, + _mysqlnd_erealloc, + _mysqlnd_perealloc, + _mysqlnd_efree, + _mysqlnd_pefree, + _mysqlnd_malloc, + _mysqlnd_calloc, + _mysqlnd_realloc, + _mysqlnd_free, + _mysqlnd_pestrndup, + _mysqlnd_pestrdup +#else + mysqlnd_zend_mm_emalloc, + mysqlnd_zend_mm_pemalloc, + mysqlnd_zend_mm_ecalloc, + mysqlnd_zend_mm_pecalloc, + mysqlnd_zend_mm_erealloc, + mysqlnd_zend_mm_perealloc, + mysqlnd_zend_mm_efree, + mysqlnd_zend_mm_pefree, + mysqlnd_zend_mm_malloc, + mysqlnd_zend_mm_calloc, + mysqlnd_zend_mm_realloc, + mysqlnd_zend_mm_free, + mysqlnd_zend_mm_pestrndup, + mysqlnd_zend_mm_pestrdup +#endif +}; + + + static const char * const mysqlnd_debug_default_trace_file = /tmp/mysqlnd.trace; #ifdef ZTS @@ -994,7 +1047,119 @@ /* }}} */ +/* {{{ mysqlnd_zend_mm_emalloc */ +static void * mysqlnd_zend_mm_emalloc(size_t size MYSQLND_MEM_D) +{ + return emalloc(size); +} +/* }}} */ + +/* {{{ mysqlnd_zend_mm_pemalloc */ +static void * mysqlnd_zend_mm_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D) +{ + return pemalloc(size, persistent); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_ecalloc */ +static void * mysqlnd_zend_mm_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) +{ + return ecalloc(nmemb, size); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_pecalloc */ +static void * mysqlnd_zend_mm_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D) +{ + return pecalloc(nmemb, size, persistent); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_erealloc */ +static void * mysqlnd_zend_mm_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D) +{ + return erealloc(ptr, new_size); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_perealloc */ +static void * mysqlnd_zend_mm_perealloc(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D) +{ + return perealloc(ptr, new_size, persistent); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_efree */ +static void mysqlnd_zend_mm_efree(void * ptr MYSQLND_MEM_D) +{ + efree(ptr); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_pefree */ +static void mysqlnd_zend_mm_pefree(void * ptr, zend_bool persistent MYSQLND_MEM_D) +{ + pefree(ptr, persistent); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_malloc */ +static void * mysqlnd_zend_mm_malloc(size_t size MYSQLND_MEM_D) +{ + return malloc(size); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_calloc */ +static void * mysqlnd_zend_mm_calloc(unsigned int nmemb, size_t size MYSQLND_MEM_D) +{ + return calloc(nmemb, size); +} +/* }}} */ + + +/* {{{ mysqlnd_zend_mm_realloc */ +static void * mysqlnd_zend_mm_realloc(void * ptr, size_t new_size MYSQLND_MEM_D) +{ + return realloc(ptr, new_size); +} +/* }}} */ + +
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/config.m4 branches/PHP_5_3/ext/standard/crypt.c trunk/ext/standard/config.m4 trunk/ext/standard/crypt.c
felipe Thu, 22 Apr 2010 20:54:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298345 Log: - Fixed bug #51435 (Missing ifdefs / logic bug in crypt code cause compile errors) Bug: http://bugs.php.net/51435 (Open) Missing ifdefs / logic bug in crypt code cause compile errors Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/config.m4 U php/php-src/branches/PHP_5_3/ext/standard/crypt.c U php/php-src/trunk/ext/standard/config.m4 U php/php-src/trunk/ext/standard/crypt.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-04-22 20:23:36 UTC (rev 298344) +++ php/php-src/branches/PHP_5_3/NEWS 2010-04-22 20:54:35 UTC (rev 298345) @@ -40,6 +40,8 @@ - Fixed bug #51577 (Uninitialized memory reference with oci_bind_array_by_name) (Oracle Corp.) - Fixed bug #51445 (var_dump() invalid/slow *RECURSION* detection). (Felipe) +- Fixed bug #51435 (Missing ifdefs / logic bug in crypt code cause compile + errors). (Felipe) - Fixed bug #51394 (Error line reported incorrectly if error handler throws an exception). (Stas) - Fixed bug #51393 (DateTime::createFromFormat() fails if format string contains Modified: php/php-src/branches/PHP_5_3/ext/standard/config.m4 === --- php/php-src/branches/PHP_5_3/ext/standard/config.m4 2010-04-22 20:23:36 UTC (rev 298344) +++ php/php-src/branches/PHP_5_3/ext/standard/config.m4 2010-04-22 20:54:35 UTC (rev 298345) @@ -306,6 +306,15 @@ fi AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt]) + if test $ac_cv_crypt_md5 = yes; then +ac_result=1 +ac_crypt_md5=1 + else +ac_result=0 +ac_crypt_md5=0 + fi + AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt]) + if test $ac_cv_crypt_sha512 = yes; then ac_result=1 ac_crypt_sha512=1 @@ -313,7 +322,7 @@ ac_result=0 ac_crypt_sha512=0 fi - AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) if test $ac_cv_crypt_sha256 = yes; then ac_result=1 @@ -322,7 +331,7 @@ ac_result=0 ac_crypt_sha256=0 fi - AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt]) AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des]) fi Modified: php/php-src/branches/PHP_5_3/ext/standard/crypt.c === --- php/php-src/branches/PHP_5_3/ext/standard/crypt.c 2010-04-22 20:23:36 UTC (rev 298344) +++ php/php-src/branches/PHP_5_3/ext/standard/crypt.c 2010-04-22 20:54:35 UTC (rev 298345) @@ -29,7 +29,7 @@ #if HAVE_UNISTD_H #include unistd.h #endif -#ifdef PHP_USE_PHP_CRYPT_R +#if PHP_USE_PHP_CRYPT_R # include php_crypt_r.h # include crypt_freesec.h #else @@ -111,7 +111,7 @@ REGISTER_LONG_CONSTANT(CRYPT_SHA512, PHP_SHA512_CRYPT, CONST_CS | CONST_PERSISTENT); -#ifdef PHP_USE_PHP_CRYPT_R +#if PHP_USE_PHP_CRYPT_R php_init_crypt_r(); #endif @@ -121,7 +121,7 @@ PHP_MSHUTDOWN_FUNCTION(crypt) /* {{{ */ { -#ifdef PHP_USE_PHP_CRYPT_R +#if PHP_USE_PHP_CRYPT_R php_shutdown_crypt_r(); #endif Modified: php/php-src/trunk/ext/standard/config.m4 === --- php/php-src/trunk/ext/standard/config.m42010-04-22 20:23:36 UTC (rev 298344) +++ php/php-src/trunk/ext/standard/config.m42010-04-22 20:54:35 UTC (rev 298345) @@ -306,6 +306,15 @@ fi AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt]) + if test $ac_cv_crypt_md5 = yes; then +ac_result=1 +ac_crypt_md5=1 + else +ac_result=0 +ac_crypt_md5=0 + fi + AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt]) + if test $ac_cv_crypt_sha512 = yes; then ac_result=1 ac_crypt_sha512=1 @@ -313,7 +322,7 @@ ac_result=0 ac_crypt_sha512=0 fi - AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) if test $ac_cv_crypt_sha256 = yes; then ac_result=1 @@ -322,7 +331,7 @@ ac_result=0 ac_crypt_sha256=0 fi - AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
[PHP-CVS] svn: /php/php-src/trunk/Zend/tests/traits/ language003.phpt language004.phpt language005.phpt language009.phpt
gron Thu, 22 Apr 2010 21:56:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298347 Log: Changed the exclusion keyword from 'instead' to 'insteadof'. [TRAITS] #That was suggested several times already, but am still not sure whether that really reads better. #Especially since only the trait is mentioned, since the method name would be duplicated anyway. Changed paths: U php/php-src/trunk/Zend/tests/traits/language003.phpt U php/php-src/trunk/Zend/tests/traits/language004.phpt U php/php-src/trunk/Zend/tests/traits/language005.phpt U php/php-src/trunk/Zend/tests/traits/language009.phpt Modified: php/php-src/trunk/Zend/tests/traits/language003.phpt === --- php/php-src/trunk/Zend/tests/traits/language003.phpt2010-04-22 21:50:53 UTC (rev 298346) +++ php/php-src/trunk/Zend/tests/traits/language003.phpt2010-04-22 21:56:55 UTC (rev 298347) @@ -18,7 +18,7 @@ class MyHelloWorld { use Hello, World { - Hello::saySomething instead World; + Hello::saySomething insteadof World; } } Modified: php/php-src/trunk/Zend/tests/traits/language004.phpt === --- php/php-src/trunk/Zend/tests/traits/language004.phpt2010-04-22 21:50:53 UTC (rev 298346) +++ php/php-src/trunk/Zend/tests/traits/language004.phpt2010-04-22 21:56:55 UTC (rev 298347) @@ -18,7 +18,7 @@ class MyHelloWorld { use Hello, World { - Hello::saySomething instead World; + Hello::saySomething insteadof World; World::saySomething as sayWorld; } } Modified: php/php-src/trunk/Zend/tests/traits/language005.phpt === --- php/php-src/trunk/Zend/tests/traits/language005.phpt2010-04-22 21:50:53 UTC (rev 298346) +++ php/php-src/trunk/Zend/tests/traits/language005.phpt2010-04-22 21:56:55 UTC (rev 298347) @@ -24,8 +24,8 @@ class Talker { use A, B { - B::smallTalk instead A; - A::bigTalk instead B; + B::smallTalk insteadof A; + A::bigTalk insteadof B; B::bigTalk as talk; } } Modified: php/php-src/trunk/Zend/tests/traits/language009.phpt === --- php/php-src/trunk/Zend/tests/traits/language009.phpt2010-04-22 21:50:53 UTC (rev 298346) +++ php/php-src/trunk/Zend/tests/traits/language009.phpt2010-04-22 21:56:55 UTC (rev 298347) @@ -24,7 +24,7 @@ class Foo { use C, A, B { - B::foo instead A, C; + B::foo insteadof A, C; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/standard/tests/general_functions/ sys_getloadavg.phpt
kalleThu, 22 Apr 2010 22:41:42 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298349 Log: Fix the sys_getloadavg() test Changed paths: U php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt Modified: php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt === --- php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt 2010-04-22 22:05:56 UTC (rev 298348) +++ php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt 2010-04-22 22:41:42 UTC (rev 298349) @@ -21,12 +21,6 @@ [2]= float(%f) } -array(3) { - [0]= - float(%f) - [1]= - float(%f) - [2]= - float(%f) -} + +Warning: sys_getloadavg() expects exactly 0 parameters, %d given in %s Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/standard/tests/general_functions/ sys_getloadavg.phpt
kalleThu, 22 Apr 2010 22:57:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298350 Log: For real this time :-/ Changed paths: U php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt Modified: php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt === --- php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt 2010-04-22 22:41:42 UTC (rev 298349) +++ php/php-src/trunk/ext/standard/tests/general_functions/sys_getloadavg.phpt 2010-04-22 22:57:35 UTC (rev 298350) @@ -12,7 +12,11 @@ echo Done\n; ? ---EXPECTF-- +--EXPECTF-- + +Warning: sys_getloadavg() expects exactly 0 parameters, %d given in %s +NULL + array(3) { [0]= float(%f) @@ -22,5 +26,4 @@ float(%f) } -Warning: sys_getloadavg() expects exactly 0 parameters, %d given in %s Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/trunk/Zend/ zend.h zend_compile.c zend_compile.h zend_execute_API.c zend_language_parser.y zend_language_scanner.c zend_language_scanner.l zend_language_scanner_defs.
Hi Stefan 2010/4/23 Stefan Marr g...@php.net: gron Thu, 22 Apr 2010 22:05:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298348 Log: Implemented Traits for PHP as proposed in the RFC [TRAITS] You seem to use C++ style comments, these are not C89 compatible and should be /* */ instead. -- regards, Kalle Sommer Nielsen ka...@php.net -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Thu, 22 Apr 2010 23:16:15 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298351 Log: - Fixed ZTS build comment-style Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-22 22:57:35 UTC (rev 298350) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-22 23:16:15 UTC (rev 298351) @@ -2851,7 +2851,7 @@ } /* }}} */ -static void do_inheritance_check_on_method(zend_function *child, zend_function *parent) +static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) { zend_uint child_flags; zend_uint parent_flags = parent-common.fn_flags; @@ -2932,7 +2932,7 @@ return 1; /* method doesn't exist in child, copy from parent */ } - do_inheritance_check_on_method(child, parent); + do_inheritance_check_on_method(child, parent TSRMLS_CC); return 0; } @@ -3227,13 +3227,13 @@ HashTable* resulting_table; HashTable** function_tables; zend_class_entry *ce; - //zstr lcname; + /* zstr lcname; */ size_t collision = 0; size_t abstract_solved = 0; - //unsigned int name_len; + /* unsigned int name_len; */ zend_function* other_trait_fn; - current = va_arg(args, size_t); // index of current trait + current = va_arg(args, size_t); /* index of current trait */ count = va_arg(args, size_t); resulting_table = va_arg(args, HashTable*); function_tables = va_arg(args, HashTable**); @@ -3241,23 +3241,23 @@ for (i = 0; i count; i++) { if (i == current) { - continue; // just skip this, cause its the table this function is applied on + continue; /* just skip this, cause its the table this function is applied on */ } if (zend_hash_find(function_tables[i], hash_key-arKey, hash_key-nKeyLength, other_trait_fn) == SUCCESS) { - // if it is an abstract method, there is no collision + /* if it is an abstract method, there is no collision */ if (other_trait_fn-common.fn_flags ZEND_ACC_ABSTRACT) { -// we can savely free and remove it from other table +/* we can savely free and remove it from other table */ zend_function_dtor(other_trait_fn); zend_hash_del(function_tables[i], hash_key-arKey, hash_key-nKeyLength); } else { -// if it is not an abstract method, there is still no collision -// iff fn is an abstract method +/* if it is not an abstract method, there is still no collision */ +/* if fn is an abstract method */ if (fn-common.fn_flags ZEND_ACC_ABSTRACT) { - // just mark as solved, will be added if its own trait is processed + /* just mark as solved, will be added if its own trait is processed */ abstract_solved = 1; } else { - // but else, we have a collision of non-abstract methods + /* but else, we have a collision of non-abstract methods */ collision++; zend_function_dtor(other_trait_fn); zend_hash_del(function_tables[i], hash_key-arKey, hash_key-nKeyLength); @@ -3268,7 +3268,7 @@ if (collision) { zend_function* class_fn; - // make sure method is not already overridden in class + /* make sure method is not already overridden in class */ if (zend_hash_find(ce-function_table, hash_key-arKey, hash_key-nKeyLength, class_fn) == FAILURE || class_fn-common.scope != ce) { @@ -3280,7 +3280,7 @@ } else if (abstract_solved) { zend_function_dtor(fn); } else { - // Add it to result function table + /* Add it to result function table */ if (zend_hash_add(resulting_table, hash_key-arKey, hash_key-nKeyLength, fn, sizeof(zend_function), NULL)==FAILURE) { zend_error(E_ERROR, Trait method %s has not been applied, because failure occured during updating resulting trait method table., @@ -3288,7 +3288,7 @@ } } - //efree(lcname.v); + /* efree(lcname.v); */ return ZEND_HASH_APPLY_REMOVE; } /* }}} */ @@ -3365,7 +3365,8 @@ fe-op_array.start_op = fe-op_array.opcodes; fe-op_array.function_name = newname; - //fe-op_array.prototype = fe-op_array.prototype; //was setting it to fe which does not work since fe is stack allocated and not a stable address + /* was setting it to fe which does not work since fe is stack allocated and not a stable address */ + /* fe-op_array.prototype = fe-op_array.prototype; */ if (fe-op_array.arg_info) { zend_arg_info *tmpArginfo; @@ -3388,7 +3389,7 @@ fe-op_array.brk_cont_array = (zend_brk_cont_element*)estrndup((char*)fe-op_array.brk_cont_array, sizeof(zend_brk_cont_element) * fe-op_array.last_brk_cont); - // TODO: check whether there is something similar and whether that is ok + /* TODO: check whether there is something similar and whether that is ok */ zend_literal* literals_copy = (zend_literal*)emalloc(fe-op_array.size_literal * sizeof(zend_literal)); for (i = 0; i fe-op_array.size_literal; i++) { @@ -3403,21 +3404,23
[PHP-CVS] svn: /php/php-src/trunk/ Makefile.global
kalleThu, 22 Apr 2010 23:23:10 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298352 Log: Update the deprecated directives in the MakeFile Changed paths: U php/php-src/trunk/Makefile.global Modified: php/php-src/trunk/Makefile.global === --- php/php-src/trunk/Makefile.global 2010-04-22 23:16:15 UTC (rev 298351) +++ php/php-src/trunk/Makefile.global 2010-04-22 23:23:10 UTC (rev 298352) @@ -79,7 +79,7 @@ . $$i; $(top_srcdir)/build/shtool echo -n -- -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname; \ done; \ fi` -PHP_DEPRECATED_DIRECTIVES_REGEX = '^(register_(globals|long_arrays)?|safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*=' +PHP_DEPRECATED_DIRECTIVES_REGEX = '^safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*=' test: all -...@if test ! -z $(PHP_EXECUTABLE) test -x $(PHP_EXECUTABLE); then \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Thu, 22 Apr 2010 23:25:05 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298353 Log: - Fix zend_hash_apply_with_arguments() calls on ZTS Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-22 23:23:10 UTC (rev 298352) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-22 23:25:05 UTC (rev 298353) @@ -3451,7 +3451,7 @@ _ADD_MAGIC_METHOD(ce, hash_key-arKey, hash_key-nKeyLength, fn); /* it could be necessary to update child classes as well */ - /* zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t)php_runkit_update_children_methods, 5, dce, dce, dfe, dfunc, dfunc_len); */ + /* zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t)php_runkit_update_children_methods, 5, dce, dce, dfe, dfunc, dfunc_len); */ } else { zend_function_dtor(fn); /* efree(fn); */ @@ -3576,8 +3576,8 @@ /** * Copies function table entries to target function table with applied aliasing */ -void copy_trait_function_table(HashTable *target, HashTable *source, zend_trait_alias** aliases, HashTable* exclude_table) { - zend_hash_apply_with_arguments(source, (apply_func_args_t)_copy_functions, 3, /* 3 is number of args for apply_func */ +void copy_trait_function_table(HashTable *target, HashTable *source, zend_trait_alias** aliases, HashTable* exclude_table TSRMLS_DC) { + zend_hash_apply_with_arguments(source TSRMLS_CC, (apply_func_args_t)_copy_functions, 3, /* 3 is number of args for apply_func */ target, aliases, exclude_table); } @@ -3683,13 +3683,13 @@ compile_exclude_table(exclude_table, ce-trait_precedences, ce-traits[i]); /* copies functions, applies defined aliasing, and excludes unused trait methods */ - copy_trait_function_table(function_tables[i], ce-traits[i]-function_table, ce-trait_aliases, exclude_table); + copy_trait_function_table(function_tables[i], ce-traits[i]-function_table, ce-trait_aliases, exclude_table TSRMLS_CC); zend_hash_graceful_destroy(exclude_table); } /* now merge trait methods */ for (i = 0; i ce-num_traits; i++) { - zend_hash_apply_with_arguments(function_tables[i], (apply_func_args_t)_merge_functions, 5, /* 5 is number of args for apply_func */ + zend_hash_apply_with_arguments(function_tables[i] TSRMLS_CC, (apply_func_args_t)_merge_functions, 5, /* 5 is number of args for apply_func */ i, ce-num_traits, resulting_table, function_tables, ce); } @@ -3699,7 +3699,7 @@ if there is already a method with the same name it is replaced iff ce != fn.scope -- all inherited methods are overridden, methods defined in the class are leaved untouched */ - zend_hash_apply_with_arguments(resulting_table, (apply_func_args_t)_merge_functions_to_class, 1, ce TSRMLS_CC); + zend_hash_apply_with_arguments(resulting_table TSRMLS_CC, (apply_func_args_t)_merge_functions_to_class, 1, ce); /* free temporary function tables */ for (i = 0; i ce-num_traits; i++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Fri, 23 Apr 2010 00:54:51 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298357 Log: - Fix ZTS code and CS Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-23 00:37:04 UTC (rev 298356) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-23 00:54:51 UTC (rev 298357) @@ -3244,7 +3244,7 @@ continue; /* just skip this, cause its the table this function is applied on */ } - if (zend_hash_find(function_tables[i], hash_key-arKey, hash_key-nKeyLength, other_trait_fn) == SUCCESS) { + if (zend_hash_find(function_tables[i], hash_key-arKey, hash_key-nKeyLength, (void **)other_trait_fn) == SUCCESS) { /* if it is an abstract method, there is no collision */ if (other_trait_fn-common.fn_flags ZEND_ACC_ABSTRACT) { /* we can savely free and remove it from other table */ @@ -3270,7 +3270,7 @@ zend_function* class_fn; /* make sure method is not already overridden in class */ - if (zend_hash_find(ce-function_table, hash_key-arKey, hash_key-nKeyLength, class_fn) == FAILURE + if (zend_hash_find(ce-function_table, hash_key-arKey, hash_key-nKeyLength, (void **)class_fn) == FAILURE || class_fn-common.scope != ce) { zend_error(E_WARNING, Trait method %s has not been applied, because there are collisions with other trait methods on %s, fn-common.function_name, ce-name); @@ -3344,7 +3344,7 @@ for(i = 0; i fe-op_array.last; i++) { opcode_copy[i] = fe-op_array.opcodes[i]; if (opcode_copy[i].op1_type == IS_CONST) { - zval_copy_ctor(opcode_copy[i].op1.constant); + zval_copy_ctor(CONSTANT_EX(fe-op_array, opcode_copy[i].op1.constant)); } else { if (opcode_copy[i].op1.jmp_addr = fe-op_array.opcodes opcode_copy[i].op1.jmp_addr fe-op_array.opcodes + fe-op_array.last) { @@ -3353,7 +3353,7 @@ } if (opcode_copy[i].op2_type == IS_CONST) { - zval_copy_ctor(opcode_copy[i].op2.constant); + zval_copy_ctor(CONSTANT_EX(fe-op_array, opcode_copy[i].op2.constant)); } else { if (opcode_copy[i].op2.jmp_addr = fe-op_array.opcodes opcode_copy[i].op2.jmp_addr fe-op_array.opcodes + fe-op_array.last) { @@ -3389,13 +3389,13 @@ fe-op_array.brk_cont_array = (zend_brk_cont_element*)estrndup((char*)fe-op_array.brk_cont_array, sizeof(zend_brk_cont_element) * fe-op_array.last_brk_cont); - /* TODO: check whether there is something similar and whether that is ok */ - zend_literal* literals_copy = (zend_literal*)emalloc(fe-op_array.size_literal * sizeof(zend_literal)); + /* TODO: check whether there is something similar and whether that is ok */ + zend_literal* literals_copy = (zend_literal*)emalloc(fe-op_array.size_literal * sizeof(zend_literal)); - for (i = 0; i fe-op_array.size_literal; i++) { -literals_copy[i] = fe-op_array.literals[i]; - } - fe-op_array.literals = literals_copy; + for (i = 0; i fe-op_array.size_literal; i++) { + literals_copy[i] = fe-op_array.literals[i]; + } + fe-op_array.literals = literals_copy; } /* */ @@ -3461,7 +3461,7 @@ return ZEND_HASH_APPLY_REMOVE; } -static int _copy_functions(zend_function *fn, int num_args, va_list args, zend_hash_key *hash_key) +static int _copy_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { HashTable* target; zend_trait_alias** aliases; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Fri, 23 Apr 2010 01:43:27 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298359 Log: - Fix function signature Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-23 01:10:05 UTC (rev 298358) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-23 01:43:27 UTC (rev 298359) @@ -3219,7 +3219,7 @@ } /* }}} */ -static int _merge_functions(zend_function *fn, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ +static int _merge_functions(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { size_t current; size_t i; @@ -3399,7 +3399,7 @@ } /* */ -static int _merge_functions_to_class(zend_function *fn, int num_args, va_list args, zend_hash_key *hash_key TSRMLS_DC) +static int _merge_functions_to_class(zend_function *fn TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { zend_class_entry *ce = va_arg(args, zend_class_entry*); int add = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Fri, 23 Apr 2010 01:56:03 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298360 Log: - Fix Windows build (Kalle) Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-23 01:43:27 UTC (rev 298359) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-23 01:56:03 UTC (rev 298360) @@ -3313,6 +3313,7 @@ Duplicate structures in an op_array where necessary to make an outright duplicate */ void php_runkit_function_copy_ctor(zend_function *fe, char *newname) { + zend_literal *literals_copy; zend_compiled_variable *dupvars; zend_op *opcode_copy; int i; @@ -3383,14 +3384,13 @@ fe-op_array.arg_info = tmpArginfo; } - fe-op_array.doc_comment = estrndup(fe-op_array.doc_comment, - fe-op_array.doc_comment_len); + fe-op_array.doc_comment = estrndup(fe-op_array.doc_comment, fe-op_array.doc_comment_len); fe-op_array.try_catch_array = (zend_try_catch_element*)estrndup((char*)fe-op_array.try_catch_array, sizeof(zend_try_catch_element) * fe-op_array.last_try_catch); fe-op_array.brk_cont_array = (zend_brk_cont_element*)estrndup((char*)fe-op_array.brk_cont_array, sizeof(zend_brk_cont_element) * fe-op_array.last_brk_cont); /* TODO: check whether there is something similar and whether that is ok */ - zend_literal* literals_copy = (zend_literal*)emalloc(fe-op_array.size_literal * sizeof(zend_literal)); + literals_copy = (zend_literal*)emalloc(fe-op_array.size_literal * sizeof(zend_literal)); for (i = 0; i fe-op_array.size_literal; i++) { literals_copy[i] = fe-op_array.literals[i]; @@ -3470,6 +3470,7 @@ unsigned int lcname_len; unsigned int fnname_len; zend_function fn_copy; + void* dummy; size_t i = 0; target = va_arg(args, HashTable*); @@ -3513,7 +3514,7 @@ lcname_len = strlen(fn-common.function_name); lcname = zend_str_tolower_dup(fn-common.function_name, fnname_len); - void* dummy; + if (zend_hash_find(exclude_table, lcname, lcname_len, dummy) == FAILURE) { /* is not in hashtable, thus, function is not to be excluded */ fn_copy = *fn; @@ -3530,6 +3531,8 @@ aliases[i]-trait_method-mname_len, fn-common.function_name, fnname_len) == 0)) { if (aliases[i]-alias) { + zend_uint lcname2_len; + char* lcname2; zend_function fn_copy2 = *fn; php_runkit_function_copy_ctor(fn_copy2, estrndup(aliases[i]-alias, aliases[i]-alias_len)); @@ -3540,8 +3543,8 @@ } } - zend_uint lcname2_len = aliases[i]-alias_len; - char* lcname2 = zend_str_tolower_dup(aliases[i]-alias, lcname2_len); + lcname2_len = aliases[i]-alias_len; + lcname2 = zend_str_tolower_dup(aliases[i]-alias, lcname2_len); if (zend_hash_add(target, lcname2, lcname2_len+1, fn_copy2, sizeof(zend_function), NULL)==FAILURE) { zend_error(E_ERROR, Failed to added aliased trait method (%s) to trait table. Propably there is already a trait method with same name\n, @@ -4442,15 +4445,16 @@ * The only difference will be a combined handling of them in the end. * Thus, we need another opcode here. */ if (ce-num_traits 0) { + zend_op *opline; + ce-traits = NULL; ce-num_traits = 0; ce-ce_flags |= ZEND_ACC_IMPLEMENT_TRAITS; /* opcode generation: */ - zend_op *opline; opline = get_next_op(CG(active_op_array) TSRMLS_CC); opline-opcode = ZEND_BIND_TRAITS; -SET_NODE(opline-op1, CG(implementing_class)); + SET_NODE(opline-op1, CG(implementing_class)); } CG(active_class_entry) = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_compile.c
felipe Fri, 23 Apr 2010 02:57:49 + Revision: http://svn.php.net/viewvc?view=revisionrevision=298363 Log: - Fix memory issue Changed paths: U php/php-src/trunk/Zend/zend_compile.c Modified: php/php-src/trunk/Zend/zend_compile.c === --- php/php-src/trunk/Zend/zend_compile.c 2010-04-23 02:53:01 UTC (rev 298362) +++ php/php-src/trunk/Zend/zend_compile.c 2010-04-23 02:57:49 UTC (rev 298363) @@ -3344,18 +3344,14 @@ opcode_copy = safe_emalloc(sizeof(zend_op), fe-op_array.last, 0); for(i = 0; i fe-op_array.last; i++) { opcode_copy[i] = fe-op_array.opcodes[i]; - if (opcode_copy[i].op1_type == IS_CONST) { - zval_copy_ctor(CONSTANT_EX(fe-op_array, opcode_copy[i].op1.constant)); - } else { + if (opcode_copy[i].op1_type != IS_CONST) { if (opcode_copy[i].op1.jmp_addr = fe-op_array.opcodes opcode_copy[i].op1.jmp_addr fe-op_array.opcodes + fe-op_array.last) { opcode_copy[i].op1.jmp_addr = opcode_copy + (fe-op_array.opcodes[i].op1.jmp_addr - fe-op_array.opcodes); } } - if (opcode_copy[i].op2_type == IS_CONST) { - zval_copy_ctor(CONSTANT_EX(fe-op_array, opcode_copy[i].op2.constant)); - } else { + if (opcode_copy[i].op2_type != IS_CONST) { if (opcode_copy[i].op2.jmp_addr = fe-op_array.opcodes opcode_copy[i].op2.jmp_addr fe-op_array.opcodes + fe-op_array.last) { opcode_copy[i].op2.jmp_addr = opcode_copy + (fe-op_array.opcodes[i].op2.jmp_addr - fe-op_array.opcodes); @@ -3394,6 +3390,7 @@ for (i = 0; i fe-op_array.size_literal; i++) { literals_copy[i] = fe-op_array.literals[i]; + zval_copy_ctor(literals_copy[i].constant); } fe-op_array.literals = literals_copy; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php