Torbjorn Granlund
20 Nov 2002 13:03:58 +0100

Jason Moxham <> writes:

  for the function 

  mpn_pow_1(mp_ptr rp, mp_srcptr bp, mp_size_t bn, mp_limb_t exp, mp_ptr tp)

  how much space is required at rp ? 
  clearly it needs enough space for the result , but does it need any extra 

  how much space is required at tp ? which I assume is a temporary varible

As for all internal functions, that is undefined.  For now,
I suggest that you check current callers.

We have some plans for adding an internal mechanism for
sizing temp allocations, and at the same time change the API
of many internal functions to require all temp space to be
passed by callers.

A typical use might look like this:

n = GMP_TEMP_ALLOC_mpn_pow_1(bp,bn,exp);
temp = GMP_ALLOC_TEMP (n);
mpn_pow_1 (...);

The various GMP_TEMP_ALLOC_* will take whatever parameters
we think might ever make sense.  A particular implementation
might ignore a subset of passed parameters.  These will be
macros, so "passing" a parameter that is ignored has zero