46 |
#error Need alloca for GMP |
#error Need alloca for GMP |
47 |
#endif |
#endif |
48 |
|
|
49 |
|
/* Add fourth argument af to the SETQ macros to allow for malloc allocation */ |
50 |
|
/* inside setjmp frames, and faster alloca allocation otherwise.*/ |
51 |
|
/* FIXME, verify that IDECL need not be changed, improve logic behind malloc */ |
52 |
|
/* selection, e.g. closure boundaries. CM 20031201*/ |
53 |
#define IDECL(a,b,c) mp_limb_t *c=(mp_limb_t *)alloca(1*sizeof(mp_limb_t));MP_INT b={1,1,c}; a = &b |
#define IDECL(a,b,c) mp_limb_t *c=(mp_limb_t *)alloca(1*sizeof(mp_limb_t));MP_INT b={1,1,c}; a = &b |
54 |
#define SETQ_IO(var,alloc,val) { object _xx = (val); \ |
#define SETQ_IO(var,alloc,val,af) { object _xx = (val); \ |
55 |
int _n; \ |
int _n; \ |
56 |
if ((_n=obj_to_mpz(_xx,(var)))) {\ |
if ((_n=obj_to_mpz(_xx,(var)))) {\ |
57 |
obj_to_mpz1(_xx,(var),alloca(_n));}} |
obj_to_mpz1(_xx,(var),af(_n));}} |
58 |
#define SETQ_II(var,alloc,val) { MP_INT * _xx = (val); \ |
#define SETQ_II(var,alloc,val,af) { MP_INT * _xx = (val); \ |
59 |
int _n; \ |
int _n; \ |
60 |
if ((_n=mpz_to_mpz(_xx,(var)))) {\ |
if ((_n=mpz_to_mpz(_xx,(var)))) {\ |
61 |
mpz_to_mpz1(_xx,(var),alloca(_n));}} |
mpz_to_mpz1(_xx,(var),af(_n));}} |
62 |
#define ISETQ_FIX(a,b,c) isetq_fix(a,c) |
#define ISETQ_FIX(a,b,c) isetq_fix(a,c) |
63 |
|
|
64 |
|
|