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

"Chris Thomasson" wrote in message
news:p-qdnalxGdJLN5_VnZ2dnUVZ_tijnZ2d@comcast.com...
> "Chris Thomasson" wrote in message
> news:TMCdnanpTvavOp_VnZ2dnUVZ_uCinZ2d@comcast.com...
>>
>> "Chris Thomasson" wrote in message
>> news:RrGdnZr1EfRYPZ_VnZ2dnUVZ_qOknZ2d@comcast.com...
>>> "Razii" wrote in message
>>> news:r84504tsla9563r79shakgbg4r37ju4vjs@4ax.com...
>>>> On Sun, 13 Apr 2008 23:41:29 +0200, "Bo Persson" wrote:
>>>>
>>>>>Isn't that what I said? The new and delete operators are not used very
>>>>>often in the code. Perhaps only once each in std::allocator, where
>>>>>they don't allocate int-sized objects, and never 10 million times in a
>>>>>loop.
>>>>
>>>> std::vector has new and delete. They are still there and must be there
>>>> every time memory is allocated dynamically.
>>>>
>>>>>That's why the benchmark is silly - you would never do anything like
>>>>>that in real C++ code.
>>>>
>>>> It's not silly. It's a benchmark that tests dynamic memory allocation
>>>> and GC performance.
>> [...]
>>
>> Your test is silly because it leaks a whole lot of memory! WTF? This
>> means that your not taking advantage of the cache allocator. Or any
>> caching in the new/delete implementation for that matter!
>>
>> YIKES!
>>
>> I will try and fix it...
>
> Okay. The fix was simple enough:
> ____________________________________________________________________
[...]
>
> ____________________________________________________________________
>
>
>
> Alls you have to do is define RAZII_MEMORY_LEAK_VERSION to see just how
> many objects you were leaking! It was a shi%load. Anyway, try this out,
> and report the numbers.

I don't know WTF I was thinking. The code on the site:

http://pastebin.com/f6bfa4d78

is fine. I wonder what happened. Anyway, I apologize.