_mp_alloc vs ALLOC

bodrato at mail.dm.unipi.it bodrato at mail.dm.unipi.it
Fri Jun 1 09:46:35 CEST 2012


Il Ven, 1 Giugno 2012 9:16 am, Marc Glisse ha scritto:
> On Fri, 1 Jun 2012, bodrato at mail.dm.unipi.it wrote:
>> - should we ask for a fourth function (alloc, free,
>> conservative_realloc,
>> nonconservative_realloc)?
> If the usual allocators don't provide it, it is inconvenient to require

Both reallocs can be optional.

> it (I know this is a chicken and egg thing...). By "conservative", do you
> mean "copying", so the conservative one would be the regular realloc and
> the other one could safely be realloc or free+malloc?

Exactly! It is not required, for the "nonconservative", to be destructive.

We could even add an mp_set_newalloc_function( ... ) now, without breaking
backward compatibility. But I think that it is better to think to all the
details, and possibly change the ABI, at once.



More information about the gmp-devel mailing list