2 ms·
TNeo never allocates memory from heap: it only operates on objects that are given as parameters to some system services. And this is really good: a great deal o
by dimonomid 11y ago
TNeo never allocates memory from heap: it only operates on objects that are given as parameters to some system services. And this is really good: a great deal of embedded systems don't use heap at all (since heap behaviour is not deterministic enough).
So, for example, when task is waiting for some mutex, this task is added to the list of waiting tasks of this mutex, and this operation is O(1), that is, it is always done in constant time.
With the implementation you proposed, we have two options:
1) When adding new object to some linked list, TNeo should internally allocate this list item from heap (or from some preallocated pool);
2) The client should allocate TN_ListItem-s manually (in whatever way), and provide it to any system service that may need it.
Both options are unacceptable.