DIP60: @nogc attribute

Manu via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 19 17:59:14 PDT 2014


On 20 April 2014 06:56, via Digitalmars-d <digitalmars-d at puremagic.com>wrote:

> I think it would be useful to be able to mark structs as @nogc_alloc or
> something similar.
>
> 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?


Even with @nogc threads for audio/visual real time computations the GC
> itself will have to get down to consistent < 50-200ms freezes to get fluid
> interaction for content computations.
>

50ms is 3 whole frames, 200ms is 12.5 frames! I thought you were a realtime
programmer?
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
your entire world exists within 16ms slices, how can you budget the frame's
usual workload around the GC interruption?
And what if the GC interrupts more than once per frame? What if you have
very little free memory?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140420/ff8ebdb8/attachment.html>


More information about the Digitalmars-d mailing list