#1670 adding static queue methods #1673

Open
daveythacher wants to merge 2 commits from daveythacher/1670_add_static_queue into develop
daveythacher commented 2024-03-18 07:52:15 -05:00 (Migrated from github.com)

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.

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.
peterharperuk commented 2024-03-18 09:14:22 -05:00 (Migrated from github.com)

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.

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.
daveythacher commented 2024-03-18 10:10:24 -05:00 (Migrated from github.com)

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.

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.
peterharperuk commented 2024-03-18 10:31:02 -05:00 (Migrated from github.com)

It might be possible to assert the memory is in the heap? But you can leave queue_free as it is for now.

It might be possible to assert the memory is in the heap? But you can leave queue_free as it is for now.
daveythacher commented 2024-03-21 11:35:36 -05:00 (Migrated from github.com)

Any objections to removing the heap completely? (Probably more of a question for version 2.0 of the SDK.)

Any objections to removing the heap completely? (Probably more of a question for version 2.0 of the SDK.)
peterharperuk commented 2024-03-22 05:51:26 -05:00 (Migrated from github.com)

I think as much as we'd like to remove stuff we don't like, we're stuck with it for the time being.

I think as much as we'd like to remove stuff we don't like, we're stuck with it for the time being.
This pull request has changes conflicting with the target branch.
  • src/common/pico_util/queue.c
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'daveythacher/1670_add_static_queue:daveythacher/1670_add_static_queue'
git switch 'daveythacher/1670_add_static_queue'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'develop'
git merge --no-ff 'daveythacher/1670_add_static_queue'
git switch 'daveythacher/1670_add_static_queue'
git rebase 'develop'
git switch 'develop'
git merge --ff-only 'daveythacher/1670_add_static_queue'
git switch 'daveythacher/1670_add_static_queue'
git rebase 'develop'
git switch 'develop'
git merge --no-ff 'daveythacher/1670_add_static_queue'
git switch 'develop'
git merge --squash 'daveythacher/1670_add_static_queue'
git switch 'develop'
git merge --ff-only 'daveythacher/1670_add_static_queue'
git switch 'develop'
git merge 'daveythacher/1670_add_static_queue'
git push origin 'develop'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!1673
No description provided.