mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-24 21:41:29 -08:00
bignums: prevent bignum registers from growing too big
We had this code before, but it made non-functional in commit20f4c8931eand got removed with commit749b97d06c.
This commit is contained in:
parent
c301b108a7
commit
c2a577d609
2 changed files with 5 additions and 1 deletions
|
|
@ -46,7 +46,10 @@
|
|||
void
|
||||
_ecl_big_register_free(cl_object x)
|
||||
{
|
||||
return;
|
||||
/* We only need to free the integer when it gets too large */
|
||||
if (ECL_BIGNUM_DIM(x) > 4 * ECL_BIG_REGISTER_SIZE) {
|
||||
_ecl_big_realloc2(x, ECL_BIG_REGISTER_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
static cl_object
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ extern ECL_API _ecl_big_binary_op _ecl_big_boole_operator(int op);
|
|||
#define _ecl_big_set_index(x, f) mpz_set_ui((x)->big.big_num,(f))
|
||||
#endif
|
||||
#define _ecl_big_init2(x,size) mpz_init2((x)->big.big_num,(size)*GMP_LIMB_BITS)
|
||||
#define _ecl_big_realloc2(x,size) mpz_realloc2((x)->big.big_num,(size)*GMP_LIMB_BITS)
|
||||
#define _ecl_big_clear(x) mpz_clear((x)->big.big_num)
|
||||
#define _ecl_big_set(x,y) mpz_set((x)->big.big_num,(y)->big.big_num)
|
||||
#define _ecl_big_odd_p(x) ((mpz_get_ui(x->big.big_num) & 1) != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue