Group: comp.lang.c++
From: "Chris Thomasson"
Date: Sunday, April 13, 2008 10:15 PM
Subject: Re: Do you use a garbage collector?

"Razii" wrote in message
news:see50458s99od8e59msmj6q8ho4di1g7av@4ax.com...
> On Sun, 13 Apr 2008 19:51:10 -0700, "Chris Thomasson"
> wrote:
>
>>
>>"Razii" wrote in message
>>news:anc5041s5nprp5am3t5idhl5j9tep7uadt@4ax.com...
>>> On Sun, 13 Apr 2008 19:21:44 -0700, "Chris Thomasson"
>>> wrote:
>>>
>>>>is fine. I wonder what happened. Anyway, I apologize.
>>>
>>> Ok, that's fine. I am now confused with all the versions posted.
>>>
>>> Can you post clean the working version on pastebin site
>>>
>>> http://pastebin.com/
>>>
>>> and post the link here.
>>
>>
>>Here ya go:
>>
>>http://pastebin.com/m2493f289
>
> It's not working...When I run it, I get
>
> (00473118/19862)-Cache Prime
> (00473128/19863)-Cache Prime
> (snip)
> (00FCF9B8/250000)-Cache Overflow
> (00FCF9F8/250000)-Cache Overflow
> (snip}
> (01B31518/0)-Cache Miss!
> (01B31528/0)-Cache Miss!
> (01B31538/0)-Cache Miss!
> (01B31548/0)-Cache Miss!
> (01B31558/0)-Cache Miss!
> (snip)

What's not working? The DBG_PRINT macro only outputs anything when you
compile in debug-mode. In order to get assert, or the DBG_PRINT macros to be
nops you need to compile in non-debug mode. Then NDEBUG is defined.


#if ! defined(NDEBUG)
# include
# define DBG_PRINTF(mp_exp) std::printf mp_exp
#else
# define DBG_PRINTF(mp_exp)
#endif


I treated DBG_PRINT like the assert macro. Read about the NDEBUG
pre-processor definition and how it relates to assert here:

http://en.wikipedia.org/wiki/Assert.h


Are you sure that you have been compiling the C++ code in non-debug mode?