dmitry Fri Nov 10 12:02:22 2006 UTC Modified files: /php-src/ext/bcmath bcmath.c php_bcmath.h Log: Intialization code is moved from request startup to module startup http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/bcmath.c?r1=1.68&r2=1.69&diff_format=u Index: php-src/ext/bcmath/bcmath.c diff -u php-src/ext/bcmath/bcmath.c:1.68 php-src/ext/bcmath/bcmath.c:1.69 --- php-src/ext/bcmath/bcmath.c:1.68 Thu Sep 21 06:46:00 2006 +++ php-src/ext/bcmath/bcmath.c Fri Nov 10 12:02:22 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: bcmath.c,v 1.68 2006/09/21 06:46:00 dmitry Exp $ */ +/* $Id: bcmath.c,v 1.69 2006/11/10 12:02:22 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -33,6 +33,7 @@ ZEND_DECLARE_MODULE_GLOBALS(bcmath); static PHP_GINIT_FUNCTION(bcmath); +static PHP_GSHUTDOWN_FUNCTION(bcmath); /* {{{ arginfo */ static @@ -124,13 +125,13 @@ bcmath_functions, PHP_MINIT(bcmath), PHP_MSHUTDOWN(bcmath), - PHP_RINIT(bcmath), - PHP_RSHUTDOWN(bcmath), + NULL, + NULL, PHP_MINFO(bcmath), NO_VERSION_YET, PHP_MODULE_GLOBALS(bcmath), PHP_GINIT(bcmath), - NULL, + PHP_GSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES_EX }; @@ -150,6 +151,17 @@ static PHP_GINIT_FUNCTION(bcmath) { bcmath_globals->bc_precision = 0; + bc_init_numbers(TSRMLS_C); +} +/* }}} */ + +/* {{{ PHP_GSHUTDOWN_FUNCTION + */ +static PHP_GSHUTDOWN_FUNCTION(bcmath) +{ + _bc_free_num_ex(&bcmath_globals->_zero_, 1); + _bc_free_num_ex(&bcmath_globals->_one_, 1); + _bc_free_num_ex(&bcmath_globals->_two_, 1); } /* }}} */ @@ -173,28 +185,6 @@ } /* }}} */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(bcmath) -{ - bc_init_numbers(TSRMLS_C); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(bcmath) -{ - _bc_free_num_ex(&BCG(_zero_), 1); - _bc_free_num_ex(&BCG(_one_), 1); - _bc_free_num_ex(&BCG(_two_), 1); - - return SUCCESS; -} -/* }}} */ - /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(bcmath) http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/php_bcmath.h?r1=1.21&r2=1.22&diff_format=u Index: php-src/ext/bcmath/php_bcmath.h diff -u php-src/ext/bcmath/php_bcmath.h:1.21 php-src/ext/bcmath/php_bcmath.h:1.22 --- php-src/ext/bcmath/php_bcmath.h:1.21 Sun Jan 1 13:09:48 2006 +++ php-src/ext/bcmath/php_bcmath.h Fri Nov 10 12:02:22 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_bcmath.h,v 1.21 2006/01/01 13:09:48 sniper Exp $ */ +/* $Id: php_bcmath.h,v 1.22 2006/11/10 12:02:22 dmitry Exp $ */ #ifndef PHP_BCMATH_H #define PHP_BCMATH_H @@ -30,8 +30,6 @@ PHP_MINIT_FUNCTION(bcmath); PHP_MSHUTDOWN_FUNCTION(bcmath); -PHP_RINIT_FUNCTION(bcmath); -PHP_RSHUTDOWN_FUNCTION(bcmath); PHP_MINFO_FUNCTION(bcmath); PHP_FUNCTION(bcadd);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php