On Thursday, 23 May 2013 at 18:22:54 UTC, Joseph Rushton Wakeling
wrote:
On 05/23/2013 08:13 PM, Brad Anderson wrote:
Now I'm wondering what can be done to foster this newly
acquired credibility in
games. By far the biggest issue I hear about when it comes to
people working on
games in D is the garbage collector. You can work around the
GC without too
much difficulty as Manu's experience shared in his DConf talk
shows but a lot of
people new to D don't know how to do that. We could also use
some tools and
guides to help people identify and avoid GC use when necessary.
It's worth noting that our code at Sociomantic faces *exactly*
the same issues.
We cannot use Phobos because of its reliance on the GC.
Essentially, we want to have the option of avoiding GC usage in
every single function.
As a starting point, do we have a list of the Phobos functions
that allocate
using GC when there's no need to? That's a concern of Manu's
that it ought to
be possible to address relatively swiftly if the information is
to hand.
That is only part of the problem with Phobos. The bigger problem
is with the functions that DO need to allocate memory. In Tango,
and in our code, all such functions accept a buffer to store the
results in.
So that, even though they need to allocate memory, if you call
the function a thousand times, it only allocates memory once, and
keeps reusing the buffer.
I'm not sure how feasible it is to add that afterwards. I hope it
can be done without changing all the API's, but I fear it might
not be.
But anyway, after fixing the obvious Phobos offenders, another
huge step would be to get TempAlloc into druntime and used
wherever possible in Phobos.