pike.git/
src/
modules/
Gmp/
mpz_glue.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-10-29
2014-10-29 17:36:04 by Martin Nilsson <nilsson@opera.com>
07bb4aeeb6e2b5ab97fba898aaaaec895e3fc745 (
13
lines) (+
3
/-
10
)
[
Show
|
Annotate
]
Branch:
8.1
Use bignum_program instead of auto_bignum_program.
52:
#define THIS_PROGRAM (fp->context->prog) struct program *mpzmod_program = NULL;
-
struct program *bignum_program = NULL;
+
PMOD_EXPORT
struct program *bignum_program = NULL;
static mpz_t mpz_int_type_min;
653:
if( TYPEOF(Pike_sp[-1]) == T_OBJECT && Pike_sp[-1].u.object->prog != bignum_program ) {
-
apply
_
svalue
(
&auto
_bignum_program, 1);
+
push
_
object
(
clone
_
object(
bignum_program, 1)
)
;
} }
2185:
PIKE_MODULE_EXIT {
-
extern struct svalue auto_bignum_program;
+
pike_exit_mpf_module(); pike_exit_mpq_module(); if(mpzmod_program)
2194:
mpzmod_program=0; }
-
free_svalue(&auto_bignum_program);
-
mark_free_svalue(&auto_bignum_program);
+
if(bignum_program) { free_program(bignum_program);
2336:
PIKE_MODULE_INIT {
-
extern struct svalue auto_bignum_program;
+
init_crc_table(); /* Make sure that gmp uses the same malloc functions as we do since
2389:
mpz_setbit (mpz_int_type_min, INT_TYPE_BITS); mpz_neg (mpz_int_type_min, mpz_int_type_min);
-
/* Magic hook in... */
-
SET_SVAL(auto_bignum_program, PIKE_T_PROGRAM, 0, program, bignum_program);
-
add_ref(bignum_program);
-
+
#ifdef INT64 mpz_init (mpz_int64_min); mpz_setbit (mpz_int64_min, INT64_BITS);