_mp_alloc vs ALLOC

Torbjorn Granlund tg at gmplib.org
Fri Feb 24 11:47:43 CET 2012


bodrato at mail.dm.unipi.it writes:

  Inspired from mpz/mul.c... Maybe we can write a macro based on:
  
  (*__gmp_free_func) (PTR(x), ALLOC (x) * BYTES_PER_MP_LIMB);
  ALLOC (x) = newsize;
  PTR(x) = (mp_ptr) (*__gmp_allocate_func) (newsize * BYTES_PER_MP_LIMB);
  
That's another possibility.

-- 
Torbjörn


More information about the gmp-devel mailing list