_mp_alloc vs ALLOC

Marc Glisse marc.glisse at inria.fr
Fri Jun 1 09:16:55 CEST 2012


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 
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? I am asking because 
other functions like try_expand (like realloc if it can do it in place, 
but if it can't, returns 0 without deallocating) can also be useful but 
are harder to provide (unless you make them always return 0). I know 
people were discussing the allocator concept for the C++ standard, but 
that doesn't seem to have led anywhere (yet?).

> - should we change the order of parameters?

I would be very afraid of doing something that confusing. If there was 
already an ABI break that changes the number of arguments maybe...

-- 
Marc Glisse


More information about the gmp-devel mailing list