Browse Source

fix to use garbage collector with --enable-gc

pre-master-46
dwarning 12 years ago
parent
commit
461026f2b9
  1. 2
      src/frontend/numparam/mystring.c
  2. 1
      src/maths/fft/fftext.c
  3. 6
      src/maths/sparse/spdefs.h

2
src/frontend/numparam/mystring.c

@ -8,11 +8,11 @@
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "ngspice/memory.h"
#include <math.h>
#include <stdarg.h>
#include "ngspice/config.h"
#include "ngspice/memory.h"
#ifdef HAS_WINGUI
#include "ngspice/wstdio.h"
#endif

1
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

6
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 <gc/gc.h>
#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"

Loading…
Cancel
Save