Remove all uses of the delete keyword and enable the Travis check#4604
Remove all uses of the delete keyword and enable the Travis check#4604JackStouffer merged 5 commits intodlang:masterfrom
Conversation
.dscanner.ini
Outdated
| exception_check="disabled" ; FIXME | ||
| ; Check for use of the deprecated 'delete' keyword | ||
| delete_check="disabled" ; FIXME | ||
| delete_check="enabled" ; FIXME |
There was a problem hiding this comment.
Can probably remove the FIXME. :-)
|
@quickfur fixed |
|
While I applaud the push to rid ourselves of Perhaps this doesn't really matter in the long run and we should just go ahead and kill off One thought that occurred to me is to replace |
If you can prove that, then honestly they should be using
Most of these are arrays, so no finalization needed. |
|
Yeah, this can't go through, it's a net pessimization. Will insert a few specific comments. |
| ? min(statbuf.st_size + 1, maxInitialAlloc) | ||
| : minInitialAlloc)); | ||
| void[] result = uninitializedArray!(ubyte[])(initialAlloc); | ||
| scope(failure) delete result; |
There was a problem hiding this comment.
Here it's known to the engineer (i.e. you) that in case of failure no trace of result will be visible from the program. So it's safe to deallocate it. Since it's not really typed, you may use GC.free(result) within a @trusted lambda.
|
We deprecated |
|
There's |
|
I don't agree with the pessimization either. |
Why not use |
|
I will make the suggested changes.
I would just like to point out that |
|
For most of the allocations in std/internal/math/biguintcore.d I can't use |
|
@andralex @WalterBright Fixed |
|
Looks much better, thanks! Makes me wonder, though, if some of these should use |
|
@quickfur Any ideas on the windows failures? |
|
Rebased |
Current coverage is 88.70% (diff: 50.00%)@@ master #4604 diff @@
==========================================
Files 121 121
Lines 73916 73915 -1
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 65565 65565
+ Misses 8351 8350 -1
Partials 0 0
|
That's pretty weird: |
|
I really don't understand where this race condition is coming from. Any help would be great. |
|
@JackStouffer an idea is possibly to split this into one PR per module, then figure out which one is causing the error. Note that |
|
Thanks @schveiguy the problem was destruction. Ready to go |
schveiguy
left a comment
There was a problem hiding this comment.
LGTM, I didn't notice the MmFile usage! Errors should have made this obvious :)
|
Pulling due to approval by team member |
|
Auto-merge toggled on |
Uh oh!
There was an error while loading. Please reload this page.