GC don't work well

Jonathan M Davis jmdavisProg at gmx.com
Tue May 29 22:53:43 PDT 2012


On Wednesday, May 30, 2012 07:47:22 Katayama Hirofumi MZ wrote:
> Look this source:
> http://codepad.org/QXAeG2aJ
> 
> The content of RbArray won't be released at the moment of
> deleting an RbArray.
> 
> Why?

It's probably only releasing the memory for RbArray and not what it refers to. 
m_objects is a dynamic array, and so it's memory is elsewhere on the heap 
rather than being part of RbArray itself. So, it probably doesn't get released 
when the RbArray is deleted.

>  Is it a bug?

Even if it were, it wouldn't get fixed. delete is being removed from the 
language. You really shouldn't be using it.

- Jonathan M Davis


More information about the Digitalmars-d mailing list