Open daveythacher opened 3 months ago
Looks ok. We might want to protect queue_free so it does nothing if it memory was not allocated on the heap? And maybe add an example, although you can leave that to us.
Queue free is a good point. Part of me wants to create a new type which forces a duplication of the API. Part of me says we could add a field to the queue structure. Overall I think we could point out in the documentation or example that queue free is not required for static queues. This is ambiguous, which can be problematic.
It might be possible to assert the memory is in the heap? But you can leave queue_free as it is for now.
Any objections to removing the heap completely? (Probably more of a question for version 2.0 of the SDK.)
I think as much as we'd like to remove stuff we don't like, we're stuck with it for the time being.
Adding static_queue_init and static_queue_init_spinlock. These accept a pointer to a static storage array. This allows using the queue API without calloc. Added null checks to queue logic also.
No testing performed.