Skip to content

Commit 48920be

Browse files
committed
Init shared context in rinit rather than minit
1 parent 1964c1f commit 48920be

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

php_decimal.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,13 +2583,6 @@ PHP_MINIT_FUNCTION(decimal)
25832583

25842584
ZEND_INIT_MODULE_GLOBALS(decimal, php_decimal_init_globals, NULL);
25852585

2586-
/* Initialize the shared context */
2587-
mpd_init(php_decimal_context(), PHP_DECIMAL_DEFAULT_PRECISION);
2588-
2589-
/* Set default rounding */
2590-
mpd_qsettraps(php_decimal_context(), PHP_DECIMAL_TRAPS);
2591-
mpd_qsetround(php_decimal_context(), PHP_DECIMAL_DEFAULT_ROUNDING);
2592-
25932586
/* Set custom memory allocation functions */
25942587
mpd_callocfunc = php_decimal_mpd_calloc;
25952588
mpd_mallocfunc = php_decimal_mpd_malloc;
@@ -2615,6 +2608,13 @@ PHP_MSHUTDOWN_FUNCTION(decimal)
26152608
*/
26162609
PHP_RINIT_FUNCTION(decimal)
26172610
{
2611+
/* Initialize the shared context */
2612+
mpd_init(php_decimal_context(), PHP_DECIMAL_DEFAULT_PRECISION);
2613+
2614+
/* Set default rounding */
2615+
mpd_qsettraps(php_decimal_context(), PHP_DECIMAL_TRAPS);
2616+
mpd_qsetround(php_decimal_context(), PHP_DECIMAL_DEFAULT_ROUNDING);
2617+
26182618
#if defined(COMPILE_DL_DECIMAL) && defined(ZTS)
26192619
ZEND_TSRMLS_CACHE_UPDATE();
26202620
#endif

0 commit comments

Comments
 (0)