ros-controls / realtime_tools

Contains a set of tools that can be used from a hard realtime thread, without breaking the realtime behavior.
https://control.ros.org
BSD 3-Clause "New" or "Revised" License
140 stars 76 forks source link

Adapt API style of lock_memory to match the one of the other functions #209

Closed firesurfer closed 3 days ago

firesurfer commented 3 days ago

This PR adapts the API style of the lock_memory function to match the style of the other methods.

I will create a PR that adapts the usage in ros2 control: https://github.com/search?q=repo%3Aros-controls%2Fros2_control%20lock_memory&type=code

Which is also the only place it is currently used: https://github.com/search?q=realtime_tools%3A%3Alock_memory&type=code

saikishor commented 3 days ago

This is API breaking. I prefer to have a proper deprecation

codecov-commenter commented 3 days ago

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 72.55%. Comparing base (d976477) to head (bfb11f7).

Files with missing lines Patch % Lines
src/realtime_helpers.cpp 0.00% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #209 +/- ## ========================================== - Coverage 73.42% 72.55% -0.88% ========================================== Files 7 7 Lines 414 419 +5 Branches 68 68 ========================================== Hits 304 304 - Misses 68 73 +5 Partials 42 42 ``` | [Flag](https://app.codecov.io/gh/ros-controls/realtime_tools/pull/209/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ros-controls/realtime_tools/pull/209/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | `72.55% <0.00%> (-0.88%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/ros-controls/realtime_tools/pull/209?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [src/realtime\_helpers.cpp](https://app.codecov.io/gh/ros-controls/realtime_tools/pull/209?src=pr&el=tree&filepath=src%2Frealtime_helpers.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-c3JjL3JlYWx0aW1lX2hlbHBlcnMuY3Bw) | `35.22% <0.00%> (-2.13%)` | :arrow_down: |
firesurfer commented 3 days ago

@saikishor That's a very good point I missed out. I adapted the PR accordingly.