seize control of the functions gmp/mpir uses for memory allocation