On Monday, 18 February 2013 at 17:49:28 UTC, JoeCoder wrote:
On 2/18/2013 5:35 AM, Benjamin Thaut wrote:
I wen't down this path already and I ended up not using the GC
at all:
http://3d.benjamin-thaut.de/?p=20
I very much enjoyed this article. Hopefully your changes can
be applied upstream.
A couple of my own ideas, in hopes that those with more
knowledge can comment:
1. A @nogc attribute. This would work similarly to
pure/safe/nothrow and would check at compile time that
annotated functions or any they call allocate any memory
enforced by the GC. Then phobos would no longer be a
"landmine" for those with realtime requirements.
2. GC.collect(timeout). This would run a collection only
until timeout is reached. It could be called with
timeout=remaining frame time, and would allow expensive
collections to span multiple frames.
Maybe a DIP should be written up to get this idea on the radar.
Some means to safely disable the GC without fear of using
features that perform hidden allocations is a real necessity.
Even with a better GC, there will still be a requirement to
disable it for some applications.
--rt