-
Notifications
You must be signed in to change notification settings - Fork 162
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
Proposal of changes for RMW_Preallocate. #383
Conversation
rcl/src/rcl/publisher.c
Outdated
@@ -37,6 +37,7 @@ typedef struct rcl_publisher_impl_t | |||
rcl_publisher_options_t options; | |||
rcl_context_t * context; | |||
rmw_publisher_t * rmw_handle; | |||
rmw_publisher_allocation_t * allocation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot just store a publish preallocation in the publisher because it is not thread safe. The preallocation needs to be created by the user or by rclcpp in order to ensure it is used in a thread safe manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. In that case the RCL should be changed or augmented to allow the user to pass the allocation to RCL.
ac7a66f
to
c03e4fb
Compare
Currently the test_memory_prealloc tests are built with the LD_BIND_NOW=1 option. This is because without that option the tests fail. Apparently the dynamic linker is allocating memory on run-time and that makes the memory tests fail. |
At what step? publish? The library should already be loaded at that point. If it is TLS, we have functions to address specific cases of that, e.g.: https://github.com/ros2/rcutils/blob/fe82622f3c9d76400ad6065229777aa013fb8628/include/rcutils/error_handling.h#L101-L141 |
I think this is connected to the wrong card. The description should be updated to connect to ros2/rmw#159, right? |
You are right. It is now connected to the right card. Thanks |
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
…nt ests Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
5042aa5
to
ae8e0ca
Compare
The idea is to have a bool value in init_options to enable the
rmw_preallocate
feature.Connects to ros2/rmw#159