secd/src/gmp_setup.c

18 lines
338 B
C

#include <stdlib.h>
#include <stdio.h>
#include <gc.h>
#include <gmp.h>
void gmp_free(void* p, size_t s) {
GC_FREE(p); // TODO: see if this performs better than a NOP
}
void* gmp_realloc(void* p, size_t o, size_t n) {
return GC_REALLOC(p, n);
}
void gmp_init(void) {
mp_set_memory_functions(GC_malloc, gmp_realloc, gmp_free);
}