On Sat Jan 17, 2026 at 2:35 PM GMT, Danilo Krummrich wrote:
> On Sat Jan 17, 2026 at 3:23 PM CET, Alice Ryhl wrote:
>> On Sat, Jan 17, 2026 at 01:23:57PM +0000, Alice Ryhl wrote:
>>> On Fri, Jan 16, 2026 at 03:49:54PM -0600, Timur Tabi wrote:
>>> > +    pub unsafe fn write_buffer(
>>> > +        &mut self,
>>> > +        data: *const u8,
>>> > +        len: usize,
>>> > +        offset: usize,
>>> > +        count: usize,
>>> > +    ) -> Result {
>>> 
>>> Why not this signature?
>>> 
>>>     unsafe fn write_raw_slice(&mut self, data: *const [u8]) -> Result;
>>> 
>>> You can implement `write_slice` in terms of it.
>>
>> To clarify, I think this would be a simpler signature for
>> `write_buffer()`. And `write_raw_slice()` can be used both for DMA and
>> to simplify the existing `write_slice`.
>
> I.e. you can use it also to create a safe helper for DMA:
>
>       fn write_dma(
>           &mut self,
>           data: &dma::CoherentAllocation<u8>,
>           offset: usize,
>           count: usize
>       ) -> Result;

Would it make sense to expose a `&CoherentAllocation<u8>` -> `&[Atomic<u8>]`
conversion method and have a `write_slice(&mut self, data: &[Atomic<[u8]>)` for
`UserSliceWriter`?

Best,
Gary

Reply via email to