-
-
Notifications
You must be signed in to change notification settings - Fork 411
Remove callStructDtorsDuringGC rt flag #2509
Conversation
|
Thanks for your pull request and interest in making D better, @edi33416! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. 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. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2509" |
|
This i separate from the not calling the GC at all on shutdown, right? |
As far as I can tell, this is only used by |
jacob-carlborg
left a comment
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.
This needs to go through the depreciation process.
|
I wonder how to deprecate this - issue a message at runtime to stderr if the flag is false? |
A long time ago, the GC would not call destructors on heap allocated struct. When it was fixed, I think this was put as a transitional step. #864 |
rainers
left a comment
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.
I'm fine with removal. AFAICT it has never been documented so we might consider it internal and skip a deprecation, or make that a short one.
Printing a deprecation message in lifetime_init if the setting is found seems like the obvious choice.
| delete arr1; | ||
| assert(dtorCount == 7); | ||
|
|
||
| if (callStructDtorsDuringGC) |
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.
Please remove scoping/indentation, too. Later it will just confuse people why it is there sometimes, and sometimes not.
I would print the message as long as the flag has been passed to the application, regardless of the value of the flag. Regarding stderr. I don't know if we should worry about this, but on AppVeyor, if any output occurs on stderr the build is failed. When the deprecation should turn into an error we can throw an exception. |
Are any of the druntime flags documented? |
No. "Luckily", druntime is chronically under-documented. |
|
I think it should be deprecated anyway. It's not difficult to do. For me it's enough for it to be deprecated for one release. |
|
'// this is run before static ctors, so it is safe to modify immutables' Wow, incredible. Very nice to get rid of this kind of UB in druntime code. |
Immutable globals can be initialised in static constructors, so whether this is UB or not is questionable. |
|
@andralex @jacob-carlborg I opened #2513 for the deprecation of the feature |
Struct dtors should always be called; we shouldn't allow configuration files to change the meaning of the language.
Edit: Anyone knows when and why was this introduced? Any projects using it?