GMP 6 the incomatible GMP?

Niels Möller nisse at
Tue Jan 8 00:17:18 CET 2013

Torbjorn Granlund <tg at> writes:

> The idea is to instead make a 64-bit bitfield of the _mp_size and
> _mp_alloc fields.  One would give _mp_size about 48 bits, and _mp_alloc
> the remaining 16.  The alloc field would lose granularity, but should
> code small sizes exactly.

Hmm. I guess one could go down to only 8 bits or so for the alloc field,
and for larger allocations, store the number of allocated limbs at the
head of the limb array (in the case limb size is not artificially small,
it could be just _mp_d[-1]).

Do you think 48 bits (or 47 bits absolute value) for _mp_size will be
large enough for the foreseeable future (say, 10 years)?

There are also other tweaks discussed for mpz_t, to allow initialization
without allocation.


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