_mp_alloc vs ALLOC

Niels Möller nisse at lysator.liu.se
Mon Jun 4 21:20:40 CEST 2012

Torbjorn Granlund <tg at gmplib.org> writes:

> Last time you suggested this, I think I asked you to explain how to do
> with the multitude of multiply functions, which might need to store the
> full n-limb value in a new large temp area, then copy its low n-1 limbs
> to the target area.

One would have to convert them all to the new convention, to avoid the
scenario you describe. I think it's a fairly easy change for all the
multiply functions which I have looked into, and I'm not aware of any
multiplication algorithm in gmp which fundamentally needs to store the
complete product including the top limb. The challenge is the large
number of affected functions. The most practical way to do that, I
think, is to start from the bottom up: The various basecase
implementations (which is a pretty large group by themselves), then the
toom-variants, then fft.


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