Skip to content

WIP Safe pointers #4544

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

Closed
wants to merge 3 commits into from
Closed

WIP Safe pointers #4544

wants to merge 3 commits into from

Conversation

sharwell
Copy link
Member

@sharwell sharwell commented Dec 8, 2019

Locally I converted most owned native objects to std::unique_ptr and std::shared_ptr. This pull request represents a relatively easy-to-review subset of the changes with minimal overall fan-out in the code.

@sharwell sharwell requested a review from a team as a code owner December 8, 2019 00:23
Comment on lines -141 to -145
for (int i = 0; i < num_threads_; ++i)
{
delete samplers_[i];
}
delete[] samplers_;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 This block was responsible for some of the crashes observed in CI, and especially the crashes prior to 0cbfa54. The destructor is missing a null check for samplers_.

@sharwell sharwell changed the title Safe pointers WIP Safe pointers Dec 8, 2019
@codecov
Copy link

codecov bot commented Dec 8, 2019

Codecov Report

Merging #4544 into master will decrease coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4544      +/-   ##
==========================================
- Coverage    75.1%    75.1%   -0.01%     
==========================================
  Files         908      908              
  Lines      160260   160260              
  Branches    17259    17259              
==========================================
- Hits       120369   120357      -12     
- Misses      35070    35086      +16     
+ Partials     4821     4817       -4
Flag Coverage Δ
#Debug 75.1% <ø> (-0.01%) ⬇️
#production 70.5% <ø> (-0.01%) ⬇️
#test 90.26% <ø> (ø) ⬆️
Impacted Files Coverage Δ
src/Microsoft.ML.AutoML/Sweepers/ISweeper.cs 59.49% <0%> (-7.6%) ⬇️
src/Microsoft.ML.AutoML/Sweepers/Parameters.cs 77.96% <0%> (-5.09%) ⬇️
...soft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs 84.9% <0%> (-0.21%) ⬇️
src/Microsoft.ML.Transforms/Text/LdaTransform.cs 84.44% <0%> (-0.16%) ⬇️
...rosoft.ML.AutoML/ColumnInference/TextFileSample.cs 64.9% <0%> (+5.29%) ⬆️

@sharwell
Copy link
Member Author

sharwell commented Dec 8, 2019

Superseded by #4551.

@sharwell sharwell closed this Dec 8, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant