bodr...@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 going to be more expensive in the case that the allocator could grow the block in place. I imagine that's a likely case when the new size is just slightly larger than the old size. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26. Internet email is subject to wholesale government surveillance. _______________________________________________ gmp-devel mailing list gmp-devel@gmplib.org http://gmplib.org/mailman/listinfo/gmp-devel