mpz_fac_ui calls shrinking realloc

Marc Glisse marc.glisse at inria.fr
Sat Mar 19 14:27:27 CET 2011


Hello,

this is not a bug, but a surprising behavior:
mpz_fac_ui often calls realloc to shrink its first parameter.

Is that done on purpose? Other than there, shrinking seems very rare in 
gmp, the main exceptions being:
- *_get_str, but it shrinks a string, not a gmp type, and only if it 
allocated the string itself);
- mpf, where precision and allocation are a single number.

-- 
Marc Glisse


More information about the gmp-discuss mailing list