Additional memory handler features.

Marc Glisse marc.glisse at inria.fr
Sat Jan 3 22:09:24 UTC 2015


On Sat, 3 Jan 2015, Niels Möller wrote:

> Honestly, I don't fully understand why we have the customizable
> allocation at all. I'm aware of only one real usecase, and that's hooks
> into certain types of garbage collectors. And then there's some
> *potential* to use them to implement better recovery on allocation
> failure, as has been discussed recently, but no one is doing that for
> real as far as I know.

Er, people have been using the custom allocators for (possibly imperfect) 
recovery on allocation failure for years. PPL's configure script complains 
if gmp was compiled without -fexceptions for that reason. Apparently 
SWI-Prolog uses longjmp (http://stackoverflow.com/a/14245611/1918193).

> To make it possible to really stay in full control of allocation with
> GMP, another option is to push forward with the itch/scratch-ifying of
> the mpn functions, and then stick to using mpn.

+1

Although itch/scratch may force a compromise between overestimating the 
space required or spending too long estimating it, which I hope won't 
penalize small numbers too much.

-- 
Marc Glisse


More information about the gmp-devel mailing list