GMP Questions (Lucien Hayen)
Jim White
mathimagics at yahoo.co.uk
Tue Oct 18 14:07:30 CEST 2005
> Q1.
> a. Can anyone tell me where to find a more up to
> date manual, if there is one, and
> b. if there are any differences with the manual
> I have.
a. Section 1 (Introduction) p2: "For up-to-date
information, please see ...."
b. Section 2.1, p9. Note the very last entry.
Utilities such as "diff" may be useful.
> Q2.
> Chapter 3, section 3.8 (page 19) mentions the
> variable mp_bits_per_limb.... Chapter 8, section
> 8.1 (page 62) mentions GMP_LIMB_BITS. What is the
> difference between the two ?
GMP_LIMB_BITS is just an alias for the global comstant
mp_bits_per_limb. The alias is convenient for the
purposes of the Nails discussion.
> Q3.
> In gmp.h I found : #define GMP_LIMB_BITS 32 where
> I would have expected something more like ...
> .. Is there a special reason for avoiding such
> definitions ?
Since the header file is itself generated by the
config process, and this macro is used in a particular
context, the question really is why would you make the
macro more complicated than it needs to be?
> Q4.
> Is there no portable way to obtain pointers to the
> active memory functions?
On the same page you refer to above (p19), you will
also find this:
"mp_set_memory_functions uses global variables to
store the selected memory allocation functions"
These are found in gmp.h, eg "__gmp_allocate_func".
More information about the gmp-discuss
mailing list