Getting completely (I mean ENTIRELY) rid off GC

Daniel Kozak via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 11 23:59:22 PDT 2014


V Fri, 12 Sep 2014 08:47:55 +0200
Jacob Carlborg via Digitalmars-d <digitalmars-d at puremagic.com> napsáno:

> 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.
> 

toUpperInPlace could help little, but still not perfect



More information about the Digitalmars-d mailing list