_mp_alloc vs ALLOC

Marc Glisse marc.glisse at inria.fr
Fri Jun 8 22:28:27 CEST 2012

On Fri, 8 Jun 2012, bodrato at mail.dm.unipi.it wrote:

> Ciao,
> Il Sab, 2 Giugno 2012 9:21 pm, bodrato at mail.dm.unipi.it ha scritto:
>> "mark" the possible uses with a different macro. So that we can count how
>> many times, and see where, we might need the no-copy-realloc.
> Macro created, nothing changed in the library, unless we WANT_ASSERT.

   ((mp_ptr) res)[0] = ~ ((mp_ptr) res)[ALLOC (z) - 1];

Won't valgrind complain about an uninitialized read here?

I think mpz_neg is a candidate for MPZ_NEWALLOC.

Marc Glisse

More information about the gmp-devel mailing list