RFC: reference counted Throwable

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 20 09:11:36 PDT 2014


On Saturday, 20 September 2014 at 15:12:45 UTC, Dicebot wrote:
> Requiring any kind of manual handling would be a huge breaking 
> change.

I'm not talking about *requiring* it; I want it to be a garbage 
collected object that 1) allocating it never triggers a 
collection cycle (so it is a @nogc allocation) and 2) you're 
allowed to explicitly free it if you want to, but if you don't, 
the gc will get around to it eventually.

We have #2 already: delete (though I'd like it to not be 
something which is allegedly deprecated). #1 is fairly easy too: 
just offer a new @nogc allocation function which creates garbage 
but does not garbage collect.

This could be a new function or the new keyword could be modified 
to suppress collection when allocating Throwable or whatever.

Maybe I'm missing something though.


More information about the Digitalmars-d mailing list