-
-
Notifications
You must be signed in to change notification settings - Fork 669
implement DIP1008 enabling @nogc for 'throw new Throwable;' #6681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b8e3716 to
66c4278
Compare
|
Please update |
Already there. |
Maybe they meant |
|
done |
|
DIP1006 ? Thats not DIP1006. |
|
Given the state of the DIP PR queue, this is likely going to be DIP 1008. |
|
Yes, I mistakenly thought 1006 was unassigned. I'll update the PR when assigned a proper number. |
d1535cd to
869f27e
Compare
|
For reference: the link to DIP 1008 is https://github.com/dlang/DIPs/blob/master/DIPs/DIP1008.md |
|
@WalterBright how about adding an actual example that ensures that one can throw in |
2b66fca to
a3bd98d
Compare
|
Needs druntime PR to be pulled first. |
|
Just manually checked. Looks like the cycle is real, but it only exists in |
Sorry, posted my comment in the wrong place. Moved it here: dlang/phobos#4712 |
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
461a98a to
8f89aa8
Compare
|
OK, time to move this along. Rebase first of all? |
|
rebased |
| @@ -0,0 +1,20 @@ | |||
| // PERMUTE_ARGS: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing argument to actually test the dip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it'll never work until the druntime changes are pulled, so I disabled it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually a good thing, it will prevent this P.R. from being pulled before it's ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what @mathias-lang-sociomantic said!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which came first, the chicken or the egg?
bd14c3e to
514369b
Compare
either this or dlang/druntime#1804 has to be pulled first. I suggest this one.
It adds the
-dip1006to enable it. Of course, throwing that switch won't work until the druntime end is done.The idea is to recognize
throw new Throwableand call_d_newThrowable()instead of_d_newclass(). When caught, add a call to_d_delThrowable()at the end of the catch block.The druntime will use
mallocandfreefor these. Reference counting is used to handle rethrowing. It should mix naturally with Throwables allocated via other means, like static and the GC.