On Saturday, 19 April 2014 at 17:41:58 UTC, Walter Bright wrote:
The first step is to identify the parts of Phobos that
unnecessarily use the GC. @nogc will help a lot with this.
Unless I missed it, I think we still haven't answered the issue
with throwing exceptions. I'm in particular interested in asserts
and Errors.
Will "assert" be usable in @nogc code? Because if not, then
basically *none* of phobos will be @nogc.
Also, I don't think statically pre-allocating the error is an
acceptable workaround.
EG:
assert(arr.length, "arr is empty.");
vs
version (assert)
{
static Error e = new Error("arr is empty.");
if (!arr.length) throw e;
}