From 461026f2b97ba929b7a17899c3ea71b3fc99159f Mon Sep 17 00:00:00 2001 From: dwarning Date: Fri, 7 Feb 2014 13:19:35 +0100 Subject: [PATCH] fix to use garbage collector with --enable-gc --- src/frontend/numparam/mystring.c | 2 +- src/maths/fft/fftext.c | 1 + src/maths/sparse/spdefs.h | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend/numparam/mystring.c b/src/frontend/numparam/mystring.c index 96e9d1a63..d5f2c5ad0 100644 --- a/src/frontend/numparam/mystring.c +++ b/src/frontend/numparam/mystring.c @@ -8,11 +8,11 @@ #include #include #include -#include "ngspice/memory.h" #include #include #include "ngspice/config.h" +#include "ngspice/memory.h" #ifdef HAS_WINGUI #include "ngspice/wstdio.h" #endif diff --git a/src/maths/fft/fftext.c b/src/maths/fft/fftext.c index d13c94247..c927965a5 100644 --- a/src/maths/fft/fftext.c +++ b/src/maths/fft/fftext.c @@ -15,6 +15,7 @@ #include "fftlib.h" #include "matlib.h" #include "ngspice/fftext.h" +#include "ngspice/config.h" #include "ngspice/memory.h" #ifndef M_PI diff --git a/src/maths/sparse/spdefs.h b/src/maths/sparse/spdefs.h index 5a76a191c..fd5237ca7 100644 --- a/src/maths/sparse/spdefs.h +++ b/src/maths/sparse/spdefs.h @@ -372,6 +372,7 @@ extern void * trealloc(void *, size_t); #define SP_FREE(ptr) { if ((ptr) != NULL) txfree(ptr); (ptr) = NULL; } +#include "ngspice/config.h" /* A new calloc */ #ifndef HAVE_LIBGC @@ -382,6 +383,11 @@ extern void * trealloc(void *, size_t); #define SP_CALLOC(ptr,type,number) \ { ptr = (type *) tmalloc((size_t)(number) * sizeof(type)); \ } +#include +#define tmalloc(m) GC_malloc(m) +#define trealloc(m, n) GC_realloc((m), (n)) +#define tfree(m) +#define txfree(m) #endif #include "ngspice/defines.h"