[Issue 5326] GC -- 99% CPU in gc at gcx@Gcx at mark()

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 10 21:37:37 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5326



--- Comment #3 from wfunction at hotmail.com 2010-12-10 21:35:51 PST ---
> PS: scope doesn't work on arrays. Your example code never explicitly free's the
memory.

That explains everything... but then, how do we delete arrays?


> void[] arrays can potentially contain references, so the GC has to mark() these
as well.

I had NO IDEA that was the case!! (see below)


> (Why are you using void[]? 10 dollars on you have no real reason.)

I actually did have a reason, but I was misunderstanding the situation. I used
void[]'s in places where I did not want ubyte[]s to be interpreted as numbers,
so that they would not be dereferenceable. (To me, a void[] could contain
binary *data*, whereas a ubyte[] logically means that it contains numbers --
and while it's OK to reference a number in a list, it's *not* OK to me to just
randomly reference an arbitrary block of data, which might contain code inside
a buffer.)
Of course, I wasn't understanding their meaning correctly, so I won't do that
anymore; thank you very much for the explanation!!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list