Getting completely (I mean ENTIRELY) rid off GC

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 11 23:47:55 PDT 2014


On 11/09/14 21:02, eles wrote:

> Could you provide one or two short but illustrative examples in Tango
> and Phobos showing the howto and the why not in Phobos?

Tango:

import tango.text.Unicode;

void foo ()
{
     char[3] result; // pre-allocate buffer on the stack
     auto b = "foo".toUpper(result);
}

Phobos:

import std.uni;

void foo ()
{
     auto b = "foo".toUpper(); // no way to use a pre-allocated buffer
}

> Will Andrei's allocators improve that with some rewrite of Phobos?

Yes, they could.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list