summaryrefslogtreecommitdiff
path: root/ext/bcmath
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-06-18 18:51:33 +0000
committerAndi Gutmans <andi@php.net>2002-06-18 18:51:33 +0000
commit52c941dc010c735608c86c18ea7c97b5526fc5fd (patch)
tree29883ecae00cbabf59b926beae974aed6c21affc /ext/bcmath
parentd4acdd349fb6541242acabbedb1ac805a581cf66 (diff)
downloadphp-git-52c941dc010c735608c86c18ea7c97b5526fc5fd.tar.gz
- Nuke use of persist_alloc(). This can't be used with a new memory manager
Diffstat (limited to 'ext/bcmath')
-rw-r--r--ext/bcmath/bcmath.c41
-rw-r--r--ext/bcmath/php_bcmath.h3
2 files changed, 12 insertions, 32 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index c999478da8..8220752e28 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -47,10 +47,10 @@ zend_module_entry bcmath_module_entry = {
STANDARD_MODULE_HEADER,
"bcmath",
bcmath_functions,
- PHP_MINIT(bcmath),
- PHP_MSHUTDOWN(bcmath),
- PHP_RINIT(bcmath),
NULL,
+ NULL,
+ PHP_RINIT(bcmath),
+ PHP_RSHUTDOWN(bcmath),
PHP_MINFO(bcmath),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
@@ -65,9 +65,9 @@ static long bc_precision;
#endif
/* Storage used for special numbers. */
-bc_num _zero_;
-bc_num _one_;
-bc_num _two_;
+extern bc_num _zero_;
+extern bc_num _one_;
+extern bc_num _two_;
/* Make a copy of a number! Just increments the reference count! */
@@ -85,34 +85,12 @@ void init_num (bc_num *num)
}
-PHP_MINIT_FUNCTION(bcmath)
-{
- extern bc_num _zero_;
- extern bc_num _one_;
- extern bc_num _two_;
-
- _zero_ = bc_new_num (1, 0);
- _one_ = bc_new_num (1, 0);
- _one_->n_value[0] = 1;
- _two_ = bc_new_num (1, 0);
- _two_->n_value[0] = 2;
- persist_alloc(_zero_);
- persist_alloc(_one_);
- persist_alloc(_two_);
- persist_alloc(_zero_->n_ptr);
- persist_alloc(_one_->n_ptr);
- persist_alloc(_two_->n_ptr);
-
- return SUCCESS;
-}
-
-
-
-PHP_MSHUTDOWN_FUNCTION(bcmath)
+PHP_RSHUTDOWN_FUNCTION(bcmath)
{
bc_free_num(&_zero_);
bc_free_num(&_one_);
bc_free_num(&_two_);
+
return SUCCESS;
}
@@ -122,6 +100,9 @@ PHP_RINIT_FUNCTION(bcmath)
if (cfg_get_long("bcmath.scale", &bc_precision)==FAILURE) {
bc_precision=0;
}
+
+ bc_init_numbers();
+
return SUCCESS;
}
diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h
index 8ead3253b8..bf57c25e88 100644
--- a/ext/bcmath/php_bcmath.h
+++ b/ext/bcmath/php_bcmath.h
@@ -26,9 +26,8 @@
extern zend_module_entry bcmath_module_entry;
#define phpext_bcmath_ptr &bcmath_module_entry
-PHP_MINIT_FUNCTION(bcmath);
-PHP_MSHUTDOWN_FUNCTION(bcmath);
PHP_RINIT_FUNCTION(bcmath);
+PHP_RSHUTDOWN_FUNCTION(bcmath);
PHP_MINFO_FUNCTION(bcmath);
PHP_FUNCTION(bcadd);