Re: [PATCH] rust: add a ring buffer implementation

From: Andreas Hindborg

Date: Mon Feb 16 2026 - 02:14:07 EST


"Daniel Almeida" <daniel.almeida@xxxxxxxxxxxxx> writes:

> Hi Andreas,
>

<cut>

>
> (sorry for the formatting, replying from my phone)
>
> We should probably make the backing memory configurable from the get go instead of hardcoding KVec. It will be cumbersome to retrofit this change later on, IMHO. I assume that others agree?
>
> For example, we can immediately use this in Tyr if you let the backing memory be a mapped GEM object. Having it be DMA memory is probably also going to be useful for others.

It should at least take flags.

iQe can make the backing completely configurable. We could have an
unsafe initializer that require just a pointer and size at the lowest
level. The current version is using array indexing to access the memory.
We could overlay a mutable slice on the pointer and continue using array
accesses. Or we could change it to just pointer offset calculations, but
that seems less idea.


Best regards,
Andreas Hindborg