Re: [PATCH] rust: add a ring buffer implementation
From: Daniel Almeida
Date: Mon Feb 16 2026 - 07:44:07 EST
> On 16 Feb 2026, at 09:26, Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> On Sun, Feb 15, 2026 at 09:24:59PM +0100, Andreas Hindborg wrote:
>> Add a fixed-capacity FIFO ring buffer. The implementation uses a circular
>> buffer with head and tail pointers, providing constant-time push and pop
>> operations.
>>
>> The module includes a few tests covering basic operations, wrap-around
>> behavior, interleaved push/pop sequences, and edge cases such as
>> single-capacity buffers.
>>
>> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
>
> Why call this ringbuffer instead of matching the stdlib name for the
> same collection? VecDeque.
>
> And a more general question .. is there any chance we could avoid
> rolling our own for this? Is there an impl in the kernel we could take?
> Or could we vendor code from stdlib?
>
Well, a pretty good reason is matching this with IoCapable as I suggested. This is also a pretty strong argument against VecDeque, since this is now unrelated to Vec itself.
— Daniel