DIP18: Non-GC threads

Piotr Szturmaj bncrbme at jadamspam.pl
Sat Sep 1 04:37:40 PDT 2012


Peter Alexander wrote:
> I think this is an unnecessary addition.
>
> I use D for game dev, and I avoid the GC + malloc like the plague,
> however I don't want to have to litter my code with distractions like
> nogc, @noheap or whatever keyword we choose.
>
> It's easy enough to avoid these without expanding the type system. I add
> trace statements to the GC in druntime, and just avoid calling malloc. I
> think this is a more practical solution to this problem than extending
> the language and cluttering my code.

It's similar behavior to nothrow and pure. Instead of manually avoiding 
GC allocations, compiler does this checks for you. Imagine D doesn't 
have nothrow. You'd have to check every called function to see if it 
doesn't throw. In big programs throwing function may be left unnoticed 
and this is why we have static nothrow checks in D.


More information about the Digitalmars-d mailing list