The GC and performance, but not what you expect

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Thu May 29 16:44:09 PDT 2014


Am Thu, 29 May 2014 20:01:16 +0000
schrieb "Sean Kelly" <sean at invisibleduck.org>:

> On Thursday, 29 May 2014 at 19:00:24 UTC, Walter Bright wrote:
> >
> > If it's single threaded, and the single thread is doing the 
> > collecting, who is starting up a new thread?
> 
> class Foo {
>       ~this() {
>           auto t = new Thread({ auto a = new char[100]; });
>           t.start();
>       }
> }

Nice try, but destructors called by the GC are currently
effectively @nogc. So don't try that at home.

-- 
Marco



More information about the Digitalmars-d mailing list