[quote="sagniknitr, post:1, topic:2630"]
What is the default heap allocator in ROS ?
[/quote]
In ROS 1 and ROS 2 the default allocators (new/delete, which are based on malloc and free) are not overridden by default.
In ROS 1 you can provide your own C++ style allocator for messages, but that's about it.
In ROS 2 you can provide your own C++ style allocator for messages, publishers, subscribers, and the executor (the thing that does `spin()`). You can also provide a custom allocator when using the C api's in ROS 2, using an allocator struct, but the default again uses malloc and free.
[quote="sagniknitr, post:1, topic:2630"]
How is it different in case of nodelets/components used in ros 2 ?
[/quote]
There are no nodelets in ROS 2, but you can compose multiple nodes into a single process in ROS 2, like you could with nodelets in ROS 1.
Composition of nodes, whether by nodelets in ROS 1 or with normal Nodes in ROS 2, has no bearing on the use of the default or custom allocators. The decision is orthogonal as far as I can see.
---
[Visit Topic](
https://discourse.ros.org/t/heap-allocator-in-ros/2630/2) or reply to this email to respond.
If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
ros-users@lists.ros.org
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <
http://lists.ros.org/mailman//options/ros-users>