This function, wait_for_work which is in the rclcpp::Executor class:
|
wait_for_work(bool nonblocking) |
- TODO's:
|
// TODO: Avoid redundant malloc's |
|
// TODO: Avoid redundant malloc's |
repeatedly malloc's for temporary storage used in the ros_middleware_interface::wait function.
This could be avoided either by only allocating memory when resizing of the structures is required or by always using a structure of the maximum possible size (still would need to be updated when nodes are added or removed but less frequently) and ensuring that the ros_middleware_interface::wait function properly handles the extra, unused storage.
This function,
wait_for_workwhich is in therclcpp::Executorclass:rclcpp/rclcpp/include/rclcpp/executor.hpp
Line 167 in 860f478
rclcpp/rclcpp/include/rclcpp/executor.hpp
Line 211 in 860f478
rclcpp/rclcpp/include/rclcpp/executor.hpp
Line 233 in 860f478
repeatedly
malloc's for temporary storage used in theros_middleware_interface::waitfunction.This could be avoided either by only allocating memory when resizing of the structures is required or by always using a structure of the maximum possible size (still would need to be updated when nodes are added or removed but less frequently) and ensuring that the
ros_middleware_interface::waitfunction properly handles the extra, unused storage.