[Galactic backport] Do not attempt to use void allocators for memory allocation
We need to fix the type of allocator passed to a publisher and a subscriber, otherwise, extra memory space is allocated at various parts of rcl.
For instance, a memory area of size sizeof(rcutils_string_map_impl_t) * sizeof(MessageT) is allocated here.
This bug not only causes extra memory consumption, but also causes std::bad_alloc in the publisher (and subscriber) that handles the message type when a huge message (larger than a few hundred MB) such as static size array is defined.
backport #1657
Signed-off-by: Takahiro Ishikawa [email protected]
@sykwer thanks for bringing this up, instead of having dedicated backport MR, can https://github.com/ros2/rclcpp/pull/1657 backport to foxy / galactic straightforward? let me try.
Given that Galactic is now EOL, closing this.