On Thu, 2026-01-15 at 15:36 +0000, Alice Ryhl wrote:
> 
> The trait approach generally requires knowing the target type at
> compile-time or paying dynamic function calls, but my understanding
> is
> that iosys exists because you might not know which variant you want
> at
> compile-time.
> 
> Perhaps we need an
> 
>       enum Iosys {
>           SystemMemory(...),
>           DmaMemory(...),
>       }
> 
> and implement Io for Iosys in terms of the inner types.

So - I didn't see this comment until now however: I personally think it
can't hurt to have a wrapper around iosys_map simply because it makes
it easier to pass back and forth from C APIs, and the other sideaffect
of Io is that it's extremely trivial to implement it for the iosys map
bindings.

The one downside I could see is that I added C helper functions for all
of the iosys map read/write operations which means they aren't
currently inlined. But iirc there's work ongoing to allow for these to
be inlined so I assume once that is finished there shouldn't be any
additional overhead from this approach.

Anyway - will send out the new version in a moment
> 
> Alice

Reply via email to