Hi,
I'm trying to wire in the Boehm garbage collector into anope to be able to find leaks in my module code. I tried substituting the system malloc with the GC malloc with some clever C preprocessor hacks, but it crashes horribly.
What I do is this:
(in services.h somewhere near the top)
#ifdef HAVE_BOEHM_GC
#include <gc/gc.h>
#undef malloc
#undef free
#undef realloc
#define malloc(x) GC_malloc(x)
#define free(x) GC_free(x)
#define realloc(x,y) GC_realloc(x,y)
#endif
GC_malloc seems to work, but modules seem to crash the rest of anope when they start to use GC_realloc and GC_free.
Who has done this succesfully?