#1670 adding static queue methods #1673
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!1673
Loading…
Reference in a new issue
No description provided.
Delete branch "daveythacher/1670_add_static_queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
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.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.