_mp_alloc to long int

Brett Kuntz kuntz at shaw.ca
Sat Jul 30 09:19:39 CEST 2022


You need to change a few more things to get bare basic support: 


gmp.h 
#include <stdint.h> 
... 
int64_t _mp_alloc; 
int64_t _mp_size; 


/mpz/realloc.c 
if (UNLIKELY (new_alloc > ULLONG_MAX / GMP_NUMB_BITS)) 
if (UNLIKELY (new_alloc > ULLONG_MAX)) 


Also you cannot use /mpz/inp_raw.c mpz_inp_raw and /mpz/out_raw.c mpz_out_raw unless you modify them. I don't use those functions so I don't bother modifying them. 

-Brett 




From: "Roman Savelyev" <rsavelyev at wlu.ca> 
To: gmp-discuss at gmplib.org 
Sent: Friday, July 29, 2022 12:12:18 PM 
Subject: _mp_alloc to long int 

A project I am working on, requires more than 2^37 limbs, more than a 64 bit system would allow, if mp_alloc is set to int. When I manually change it to long int, recompile and run, I get a segmentation fault, particularly in mpz_set_ui through gmpxx. Would you be willing to shine a light on what needs to change within the program to make it possible to make this change? 
_______________________________________________ 
gmp-discuss mailing list 
gmp-discuss at gmplib.org 
https://gmplib.org/mailman/listinfo/gmp-discuss 


More information about the gmp-discuss mailing list