Use std::unique_ptr for objects in LdaEngine#4547
Merged
sharwell merged 1 commit intodotnet:masterfrom Dec 8, 2019
Merged
Conversation
Closed
e889483 to
d5ede82
Compare
2a8b141 to
fae0d3c
Compare
Codecov Report
@@ Coverage Diff @@
## master #4547 +/- ##
==========================================
- Coverage 75.13% 75.12% -0.02%
==========================================
Files 908 908
Lines 160238 160238
Branches 17256 17256
==========================================
- Hits 120401 120379 -22
- Misses 35016 35043 +27
+ Partials 4821 4816 -5
|
fae0d3c to
6454558
Compare
sharwell
commented
Dec 8, 2019
| data_block_.reset(nullptr); | ||
| atomic_stats_.reset(nullptr); | ||
| model_block_.reset(nullptr); | ||
| samplerQueue_.reset(nullptr); |
Contributor
Author
There was a problem hiding this comment.
📝 These calls to reset are likely not required, but by including them it ensures the objects are destroyed in the same order the old code destroyed them.
sharwell
commented
Dec 8, 2019
| model_block_.reset(new LDAModelBlock()); | ||
| data_block_.reset(new LDADataBlock(num_threads_)); | ||
| process_barrier_.reset(new SimpleBarrier(num_threads_)); | ||
| samplerQueue_.reset(new CBlockedIntQueue()); |
Contributor
Author
There was a problem hiding this comment.
📝 Using reset instead of std::make_shared because some of the builds only have C++ 11 (the latter is C++ 14).
codemzs
approved these changes
Dec 8, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #4546