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

zero copy api #394

Merged
merged 5 commits into from
Oct 18, 2019
Merged

zero copy api #394

merged 5 commits into from
Oct 18, 2019

Conversation

Karsten1987
Copy link
Contributor

connects to ros2/ros2#785
Signed-off-by: Karsten Knese karsten@openrobotics.org

@dirk-thomas
Copy link
Member

How does the loaning apply to a dynamic size message like String?

@Karsten1987
Copy link
Contributor Author

We should highlight this a little bit stronger in the design doc, but essentially it's the middleware's task to declare whether or not it can loan messages of a certain message type.

If yes (for example for fixed sized arrays or POD), the memory for the loaned message is allocated by the middleware. If not, the loaned message is using an alternatively provided instance of an allocator. The idea is that if the middleware doesn't support message loaning, the user should be able to control the allocation.

The logic is implemented here: https://github.com/ros2/rclcpp/pull/864/files#diff-8c68c968941e2e05ba8974455ea3f1b5R73-R74

Independent of the middleware, the user code should always work (whether it is zero-copy or not).

@mabelzhang mabelzhang added the enhancement New feature or request label Oct 3, 2019
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

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

LGTM

@Karsten1987 Karsten1987 merged commit 31aefe2 into master Oct 18, 2019
@delete-merged-branch delete-merged-branch bot deleted the zero_copy_api branch October 18, 2019 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants