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

From: Daniel Almeida

Date: Mon Feb 16 2026 - 06:44:48 EST




> On 16 Feb 2026, at 04:14, Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> "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
>


Consider adding a second generic parameter with a bound on IoCapable. This is probably what we what here. This will let us delegate the memory accesses to the underlying IoCapable implementation.

— Daniel