Repository navigation
Remove deprecated conversion of C++ allocators to rcl allocators - #3445
christophebedard wants to merge 1 commit into
Conversation
ABI Compliance Check❌ Verdict: incompatible
✅
|
| rclcpp::allocator::has_get_rcl_allocator_v<Allocator>, | ||
| "Allocators other than std::allocator<void> must define " | ||
| "'rcl_allocator_t get_rcl_allocator()'"); | ||
| return get_allocator()->get_rcl_allocator(); |
There was a problem hiding this comment.
This is unreachable, is it needed ?
There was a problem hiding this comment.
it's not unreachable. It's kind of backwards: the static_assert() isn't actually needed, because get_allocator()->get_rcl_allocator() wouldn't compile anyway, but it gives a nicer compile error.
|
Pulls: #3445 |
|
so it seems that the deprecations this PR removes weren't actually getting shown to users, similar to #3176. Even if this probably doesn't have many users, I'll hold off on this one for now. |
Converting a C++ allocator to an rcl allocator with the generic `allocator::get_rcl_allocator()` and the `retyped_*()` functions has been deprecated since #3058 (Lyrical), since it is not valid: the size on deallocate cannot be determined. Allocators other than `std::allocator<void>` now need to define `rcl_allocator_t get_rcl_allocator()`, which is enforced with a `static_assert`. Signed-off-by: Christophe Bedard <[email protected]>
fff1e8f to
9890b5b
Compare
Description
Converting a C++ allocator to an rcl allocator with the generic
allocator::get_rcl_allocator()and theretyped_*()functions has been deprecated since #3058 (Lyrical), since it is not valid: the size on deallocate cannot be determined. Allocators other thanstd::allocator<void>now need to definercl_allocator_t get_rcl_allocator(), which is enforced with astatic_assert.Is this user-facing behavior change?
Yes:
rclcpp::allocator::retyped_allocate(),retyped_zero_allocate(),retyped_deallocate(),retyped_reallocate(), and the genericrclcpp::allocator::get_rcl_allocator()overload are removed. Allocators other thanstd::allocator<void>used with publishers, subscriptions, or message memory strategies must definercl_allocator_t get_rcl_allocator(), otherwise compilation fails.Did you use Generative AI?
Claude Opus 5.5 to find this deprecated code and remove it.
Additional Information
Requires ros2/demos#823, which defines
get_rcl_allocator()for the custom allocator tutorial, so merge that one first.