speed of mpz_odd_p and lazy allocation

Niels Möller nisse at lysator.liu.se
Wed Aug 15 21:44:53 CEST 2012

Marc Glisse <marc.glisse at inria.fr> writes:

> Hm, the reads are sometimes too eager, but when a write happens, it is
> usually important, so writing it to a scratch location is strange.

You may well be right (I haven't checked the code which does this). If
so, that seems to kill the idea of pointing to a writable scratch limb.

> My main use cases are dictated by C++.
> It would help if mpz_class::mpz_class() didn't throw => mpz_init
> doesn't throw.

Out of curiosity (I'm not really into C++), how would that help? I
thought it was fairly normal for constructors to allocate memory and
potentially fail when doing that.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-devel mailing list