bbqueue icon indicating copy to clipboard operation
bbqueue copied to clipboard

Make BBBuffer generic over the index variables

Open jamesmunns opened this issue 5 years ago • 3 comments

It would be nice to use atomic types smaller than usize for tracking variables. This could be a significant size savings for buffers like BBBuffer<U128> (18 bytes vs 6 bytes overhead on a 32-bit target).

This should be possible by following the tricks used by heapless, and could be made backwards compatible to alias current constructors to use usize as the generic parameter.

jamesmunns avatar Dec 04 '19 14:12 jamesmunns

This would also help in making this mergable into heapless, CC https://github.com/japaric/heapless/issues/65

jamesmunns avatar Dec 04 '19 14:12 jamesmunns

CC @korken89, who I think is better at generic shenanigans that I am :)

jamesmunns avatar Apr 12 '20 12:04 jamesmunns

Yeah, this is no problem to do, ping me if you want some help :)

korken89 avatar Apr 13 '20 19:04 korken89