[gclist] a puzzle, Boehm gc compatiblity with freebsd?

Rob Rodgers knave@acm.org
Fri, 24 Aug 2001 16:49:10 -0700

At 04:19 PM 8/24/2001 -0700, you wrote:
>Hello, fellow GCers

Okay, I'm sorry, I should have checked one more thing before posting.

The issue appears to be easy to resolve to some extent.  The
problem was basically that some modules WERE including the
gc header & defining malloc to GC_MALLOC, et cetera, and some
modules were NOT.  Specifically, the linked list module wasn't.  Putting
everyone on the same page did solve the problem.

#include "/homes/rsr/gc/gc/include/gc.h"
#ifdef GC_DEBUG
#define malloc(n) GC_MALLOC(n)
#define calloc(m,n) GC_MALLOC(m*n)
#define free(p) GC_FREE(p)
#define realloc(p,n) GC_REALLOC(n)
#define CHECK_LEAKS() do{ /* printf("%s %d: checking leaks\n", 
__FUNCTION__, __LINE__); */ GC_gcollect(); } while(0)
#define START_LEAK_TRACKING() do { printf("%s %d\n", __FUNCTION__, 
__LINE__); GC_find_leak = 1;} while(0)
#ifndef CHECK_LEAKS  /* make this buildable without the collector */
#define CHECK_LEAKS() do{  /*nothing*/ } while(0)
#define START_LEAK_TRACKING() do{/*nothing*/}while(0)

Is this expected behavior?  It seems like this would make life quite difficult
for those of us who want to use the GC to verify programs that are linked with
binary modules or libraries that malloc internally..