Skip to content

pass AnyExecutable objects as reference to avoid memory allocation#463

Merged
wjwwood merged 2 commits intomasterfrom
any_executable_by_reference
Apr 18, 2018
Merged

pass AnyExecutable objects as reference to avoid memory allocation#463
wjwwood merged 2 commits intomasterfrom
any_executable_by_reference

Conversation

@wjwwood
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants