Skip to content
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

pass AnyExecutable objects as reference to avoid memory allocation #463

Merged
merged 2 commits into from Apr 18, 2018

Conversation

wjwwood
Copy link
Member

@wjwwood wjwwood commented Apr 16, 2018

We've been trying to eliminate steady-state memory allocation, and this was identified as one of the easiest things we could change to avoid an unnecessary memory allocation and customization point.

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@wjwwood wjwwood added the in review Waiting for review (Kanban column) label Apr 16, 2018
@wjwwood wjwwood self-assigned this Apr 16, 2018
if (any_exec) {
RCLCPP_SCOPE_EXIT({
this->spinning.store(false);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, is this a bug fix or style fix? It looks like the macro already adds {} around its arguments.

Copy link
Member Author

Choose a reason for hiding this comment

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

Style only.

Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, there's another use of the scope exit macro on line 208 that could have {} added to it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll remove this diff and maybe make a separate pr for this change then, since its growing in scope :)

@wjwwood
Copy link
Member Author

wjwwood commented Apr 18, 2018

The style undo is net zero diff, and the Windows warning is a false positive, so I'll merge as-is.

@wjwwood wjwwood merged commit 1610fc3 into master Apr 18, 2018
@wjwwood wjwwood deleted the any_executable_by_reference branch April 18, 2018 02:54
@wjwwood wjwwood removed the in review Waiting for review (Kanban column) label Apr 18, 2018
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* Use foxy testing apt repos to install linters for Actions

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants