DIP60: @nogc attribute

via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 19 21:33:02 PDT 2014


On Sunday, 20 April 2014 at 00:59:26 UTC, Manu via Digitalmars-d 
wrote:
>> Interpretation: this struct and any data directly reachable 
>> from it is
>> guaranteed to not be GC allocated. Then a precise collector 
>> could avoid
>> scanning those and pointers to them.
>
> Why wouldn't precise GC be able to do this anyway? It already 
> has data
> about everything it scans. It can easily produce a 'don't 
> bother scanning
> this' bit at the start of that data without programmer 
> assistance?

It doesn't know what can be reached through a node in a graph. It 
doesn't know what is on the GC heap.

> In a visual realtime app, the GC will only be acceptable when 
> it will not
> interrupt for more than 1ms or so (and I consider that quite 
> generous, I'd
> be more comfortable with < 500µs). Otherwise you'll lose frames 
> anyway; if

No, because the @nogc thread will not be interrupted.

Think MVC: the model is under GC, the view/controller is under 
@nogc.



More information about the Digitalmars-d mailing list