Replace heapless queues with framed BBBuffers for URC and response queues.
This allows for a much better utilization of the memory allocated for the queues.
For example, before this PR the RES_QUEUE was able to hold RES_CAPACITY items of BUF_LEN size, leading to a memory allocation of RES_CAPACITY * BUF_LEN plus a minor overhead for the queue. The issue being that 95% of all items being enqueued in the queue is much smaller than BUF_LEN, leading to a huge memory waste, as everything is scaled for worst cases.
With this PR, the number of items in the queue is no longer fixed, but rather the queue is of N bytes len, with dynamic item sizes through framing. See https://docs.rs/bbqueue/0.4.12/bbqueue/framed/index.html for more information on overhead.
This should allow for a lower general stack usage, and a much more efficient memory usage.
NOTE
This is an internal only change, and should not affect the public API in other places than the instantiation of the queues. Nevertheless this is considered a breaking change, and should be treated as such.
Replace heapless queues with framed BBBuffers for URC and response queues.
This allows for a much better utilization of the memory allocated for the queues.
For example, before this PR the
RES_QUEUE
was able to holdRES_CAPACITY
items ofBUF_LEN
size, leading to a memory allocation ofRES_CAPACITY * BUF_LEN
plus a minor overhead for the queue. The issue being that 95% of all items being enqueued in the queue is much smaller thanBUF_LEN
, leading to a huge memory waste, as everything is scaled for worst cases.With this PR, the number of items in the queue is no longer fixed, but rather the queue is of
N
bytes len, with dynamic item sizes through framing. See https://docs.rs/bbqueue/0.4.12/bbqueue/framed/index.html for more information on overhead.This should allow for a lower general stack usage, and a much more efficient memory usage.
NOTE This is an internal only change, and should not affect the public API in other places than the instantiation of the queues. Nevertheless this is considered a breaking change, and should be treated as such.