@@ -94,6 +94,21 @@ rclc_executor_get_zero_initialized_executor(void);
94
94
* Initializes an executor.
95
95
* It creates a dynamic array with size \p number_of_handles using the
96
96
* \p allocator.
97
+ * As the Executor is intended for embedded controllers, dynamic memory management is crucial.
98
+ * Therefore at initialization of the RCLC-Executor, the user defines the total \p number_of_handles.
99
+ * A handle is a term for subscriptions, timers, services, clients and guard conditions. The
100
+ * heap will be allocated only in this phase and no more memory will be allocated in the
101
+ * running phase in the executor. However, the heap memory of corresponding wait-set is
102
+ * allocated in the first iteration of a spin-method, which calls internally rclc_executor_prepare.
103
+ * Optionally, you can also call rclc_executor_prepare before calling any of the spin-methods.
104
+ * Then all wait-set related memory allocation will be done in rclc_executor_prepare and not
105
+ * in the first iteration of the spin-method.
106
+ *
107
+ * This makes this Executor static in
108
+ * terms of memory allocation, in the sense, that during runtime no heap allocations occur.
109
+ * You can add, however, at runtime as many handles, e.g. subscriptions, to the executor
110
+ * until the maximum number of handles is reached. In this case, the wait-set needs to be
111
+ * updated and rclc_executor_prepare is called again (with dynamic memory allocation in RCL).
97
112
*
98
113
*
99
114
* * <hr>
0 commit comments