Re: [Gc] Re: Re: Re: FW: Re: Cannot print call chain

Ivan Maidanski ivmai at
Fri Jul 16 10:53:48 PDT 2010


Fri, 16 Jul 2010 17:09:52 +0000 (UTC) biosli <biosli at>:

> Hi all:
> The reason why can not print call chain, I find it!!
> Hans and Ivan are right!! I didn't defined GC_DEBUG in all my project!!
> I define GC_DEBUG in stdafx.h as
> #ifdef _DEBUG
> #  define GC_DEBUG
> #endif
> I thought when my project include gc.lib, debug log will print.
> But I commit a blunder, GC_DEBUG must be "seen" in all my project.
> So, I add 
> #if defined(_DEBUG) && !defined(GC_DEBUG)
> #  define GC_DEBUG
> #endif
> at gc.h, it works.(And does it need add in cvs?)

I don't like the idea of _DEBUG implies GC_DEBUG because _DEBUG is pre-defined by the compiler (VisualC) and it is not good to always redirect GC_MALLOC to GC_debug_malloc when you are just debugging some fragment of the client code (or we would need something like GC_DONT_DEBUG similar to GC_NOT_DLL).

For you, I don't recommend to patch gc.h for such negligible things - IMHO it's better to add
#ifdef _DEBUG
# define GC_DEBUG
to your client code just before #include "gc.h".

> Thanks for all your help. And I feel sorry about that.
> Zeyi Lee

More information about the Gc mailing list