Incorporating D

Johannes Pfau nospam at example.com
Sat Jan 26 01:41:46 PST 2013


Am Fri, 25 Jan 2013 22:38:51 +0100
schrieb "Jonathan M Davis" <jmdavisProg at gmx.com>:

> On Friday, January 25, 2013 22:33:14 q66 wrote:
> > > D's GC does not have serious problems. The only issue is
> > > controversial status of GC.
> > 
> > D's GC has inherent issues with false positives, sometimes
> > freeing memory that you don't really want freed, causing
> > (sometimes hidden) bugs that are pretty much impossible to debug.
> 
> I've _never_ heard of it freeing something when it shouldn't.

I've seen that when porting GDC. Usually happens if the GC fails to
scan the stack or more often it misses some TLS ranges. Never saw that
with dmd though.

IIRC toStringz is also dangerous. You have to make sure that the C
library does not store the pointer or also store it manually so the GC
can find it. (This is not different from passing other C/D pointers, but
with toStringz it's easy to miss).


More information about the Digitalmars-d mailing list