@nogc

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 07:16:59 PDT 2014


On Fri, Jul 11, 2014 at 04:00:01AM +0000, Chris Cain via Digitalmars-d wrote:
> On Friday, 11 July 2014 at 03:45:17 UTC, Walter Bright wrote:
> >I've thought of allowing "throw new ...", and yours would be in
> >addition to that, in @nogc functions, but was waiting to see how this
> >would play out a bit first.
> 
> Errors I agree with (basically, that's the end of your program, so
> "violating" @nogc is irrelevant in that case). "throw new ..." being
> allowed in general feels to me like it'll break the entire point of
> `@nogc` code for many people. `@nogc` was (or, at least I thought it
> was) designed to stop having people from having to read through
> implementations of everything their using to verify nothing is using
> the gc, which was error prone and time consuming. Allowing parts of
> libraries to throw/get caught somewhere inside of `@nogc` code makes
> it so you have to go back to manually verifying their not using
> exception handling somewhere. Sure, it reduces the potential footprint
> of such, but we're right back to the same old problem again that
> `@nogc` was supposed to solve. So for people saying "Oh, I want to
> avoid the GC in D", they'll just complain about how `@nogc` still
> allows you to hit the GC unintentionally once they find out. Then
> we'll have requests for `@reallynogc` to be added.

Wouldn't @reallynogc == @nogc + nothrow ?


T

-- 
The only difference between male factor and malefactor is just a little emptiness inside.


More information about the Digitalmars-d mailing list