_mp_alloc vs ALLOC

Torbjorn Granlund tg at gmplib.org
Wed Feb 22 20:32:18 CET 2012


bodrato at mail.dm.unipi.it writes:

  Unrelated :-) We might define more macros like TMP_ALLOC_LIMBS_2 . I mean
  _3 and _4. So that they can be used to reduce the number of allocations.
  Do you agree? (I just touched mpz/gcdext.c, and _4 should be used there).
  
I'd vote for killing TMP_ALLOC_LIMBS_2 rather than add TMP_ALLOC_LIMBS_N
for some range of N.

Please look at the generated code from TMP_ALLOC from any reasonable
compiler.  It is a sub from sp, the a copy from sp to the target
variable.  Cost: about 1 cycle.

TMP_ALLOC_LIMBS_2 is clutter IMHO.

-- 
Torbjörn


More information about the gmp-devel mailing list