Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use STL shared_ptr #2391

Merged
merged 5 commits into from
Jul 19, 2018
Merged

Conversation

conlain-k
Copy link
Contributor

Addresses #1493. Is a duplicate of #2257, but rebased off the latest develop. The old version was too bogged down by merge conflicts, so this is a salvage of that.

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Run unit tests and ATF tests. Will most likely require extensive testing due to number of files altered.

Summary

Converts instances of Utils::SharedPtr to std::shared_ptr, supported in C++11. Also uses std::make_shared. Converts non-standard functionality to use STL equivalents, cleans up lots of shared_ptr allocation issues.
Should only modify shared pointers in-place with no change in functionality. Internal API should be basically identical.

Changelog

Massive replacement of sharedPtrs
Conversion to use correct allocation processes in shared_ptr initialization
fix namespacing and remove custom implementations of non-standard functionality

NOTE:
Also modifies application_manager_impl.h to use subscribed_way_points_apps_list_.find(app->app_id()) instead of subscribed_way_points_apps_list_.find(app).

The subscribed_way_points_apps_list_ is a std::set<int32_t>, so indexing into it with a shared_ptr makes no sense. This is either poorly defined behavior or a bug. It may be the case that this is outside the scope of this PR, but the modification is required for the code to compile and the current code still passes all unit and SDL smoke tests.

Enhancements
  • STL-provided pointers are cleaner and more maintainable
Bug Fixes
  • see above note about the indexing

Tasks Remaining:

  • test aggressively using existing tests

CLA

@conlain-k conlain-k changed the title Feature/stl sharedptr implementation round2 Feature/stl sharedptrs Jul 18, 2018
@conlain-k conlain-k changed the title Feature/stl sharedptrs Use STL shared_ptr Jul 18, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants