On Mon, Nov 10, 2025, 01:10 Ray steven <[email protected]> wrote:
> Reasoning:
> By default, GMP aborts on allocation failure, but this behavior can be
> changed by registering custom memory functions.
Only if one registers a custom allocation function whose behavior violates
the documented [1] requirement to terminate the program on failure.
No error return is allowed from any of these functions, if they
return then they must have performed the specified operation.
In particular note that allocate_function or reallocate_function
mustn’t return NULL.
[1] https://gmplib.org/manual/Custom-Allocation