[Discourse.ros.org] [General] Heap Allocator in ROS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [General] Heap Allocator in ROS

Mikael Arguedas via ros-users


What is the default heap allocator in ROS ?
How is it different in case of nodelets/components used in ros 2 ?





---
[Visit Topic](https://discourse.ros.org/t/heap-allocator-in-ros/2630/1) 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
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] Heap Allocator in ROS

Mikael Arguedas via ros-users


[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
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>