=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/gmpq.c,v retrieving revision 1.2 retrieving revision 1.4 diff -u -p -r1.2 -r1.4 --- OpenXM_contrib2/asir2000/engine/gmpq.c 2014/01/22 02:34:58 1.2 +++ OpenXM_contrib2/asir2000/engine/gmpq.c 2015/08/07 05:30:36 1.4 @@ -21,7 +21,7 @@ void gc_free(void *p,size_t size) void init_gmpq() { - mp_set_memory_functions(Risa_GC_malloc_atomic,gc_realloc,gc_free); + mp_set_memory_functions(Risa_GC_malloc,gc_realloc,gc_free); mpz_init(ONEMPZ); mpz_set_ui(ONEMPZ,1); MPZTOGZ(ONEMPZ,ONEGZ); } @@ -217,6 +217,16 @@ void mulgz(GZ n1,GZ n2,GZ *nr) else if ( MUNIGZ(n2) ) chsgngz(n1,nr); else { mpz_init(t); mpz_mul(t,BDY(n1),BDY(n2)); MPZTOGZ(t,*nr); + } +} + +void mul1gz(GZ n1,int n2,GZ *nr) +{ + mpz_t t; + + if ( !n1 || !n2 ) *nr = 0; + else { + mpz_init(t); mpz_mul_ui(t,BDY(n1),(long)n2); MPZTOGZ(t,*nr); } }