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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 22 00:15:36 PDT 2010


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



--- Comment #3 from nfxjfg at gmail.com 2010-06-22 00:15:35 PDT ---
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.

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