mpz_limbs interface

Marc Glisse marc.glisse at inria.fr
Tue Jan 21 16:19:13 UTC 2014


On Tue, 21 Jan 2014, Niels Möller wrote:

> There's a ChangeLog entry from the day before yesterday:
>
> 	* doc/gmp.texi: Undocument mpz_array_init.

Thanks, I hadn't seen it yet.

> One can still use mpz_realloc2, which can be viewed as an allocation
> hint to the gmp implementation (so in mini-gmp, it's harmless but also
> mostly useless, due to the frequent use of mpz_swap).

I was talking of the case where I already have a preexisting buffer I want 
to use as _mp_d, I don't want to allocate a new one with mpz_realloc2. 
That seems to be a few steps further than the new limb interface goes, and 
I can understand not wanting to support that.

Playing with mp_set_memory_functions, there is a complicated way to use a 
preexisting buffer without breaking if I am using mini-gmp, but having 2 
versions of the code still seems simpler and more efficient (and that's 
all unsupported anyway).


I guess it would be hard to make an official interface that lets users 
reimplement __GMPXX_TMPZ_D.

-- 
Marc Glisse


More information about the gmp-devel mailing list