I don't think ARC would work in D. You'd need support for controlling the reference count in certain situations. You'd need type signatures for different reference types. You'd have to remove the GC.malloc function, as it would actually be manually memory managed with ARC, or otherwise return a fatter pointer, which would make it pretty useless. I hold more hope for someone improving the garbage collector implementation. This will happen sooner when someone who needs it takes the time to write it.

The key issue with GC is the pause time leading to dropped frames. Google has recently shown that you can use a garbage collector pretty excessively without losing any frames at 60FPS, by minimising the collection time so it fits within a frame.

https://www.youtube.com/watch?v=EBlTzQsUoOw#t=23m

If you wrote most of your game code with allocations you controlled and only had some minor GC activity with a sufficiently well written garbage collector, you wouldn't notice the GC getting in your way.

Whichever automatic memory management scheme you choose, if you are writing real time applications, you will ultimately have to optimise by taking more control of memory at some point. There's no automatic solution for this.

Reply via email to