GMP and static memory allocation

paul zimmermann Paul.Zimmermann at inria.fr
Fri Dec 21 21:02:02 UTC 2018


> You should begin by referring to these two sections of the GMP manual:
>   3.6 Memory management
>   13  Custom allocation
> I haven't used it myself, but my guess is that "Custom allocation" should
> solve your problem, and will not require recompiling GMP.  You will, of
> course, need to give careful consideration to the functions that you use to
> replace malloc(), etc.

you should also configure GMP with --disable-alloca to ensure temporary
objects are allocated with malloc and not alloca (thus if you redefine malloc,
with your own malloc).

Paul Zimmermann


More information about the gmp-discuss mailing list