[Issue 4358] Potential Memory Leaks in std.file.read() ?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 22 00:23:47 PDT 2010


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



--- Comment #4 from Vermi <moi at vermi.fr> 2010-06-22 00:23:46 PDT ---
(In reply to comment #3)
> Most likely, the GC _is_ working correctly. It's a conservative GC, and it
> treats integers, floats, random binary data the same as actual pointers. The GC
> doesn't have enough information to know what is pointer and what not. If an
> integer value looks like a pointer to a memory block, it's called a "false
> pointer". This may lead to memory leaks.
> 
> And the larger a memory block is, the higher the probability that a false
> pointer exists and will prevent the memory block from being free'd. At least
> that's my theory. Conclusion: use malloc() for really large arrays.

Maybe, depend of how the GC scan the stack. I will think about it.

-- 
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