On 2/6/2026 5:33 PM, Daniel Almeida wrote: >>> >>> >>> Yeah, but my point being: is there a reason why the underlying list has to >>> remain read-only? Is this a safety requirement or an invariant that is >>> established >>> by the code above? >> I'm not fully sure if it's an invariant or a safety requirement, but anyone >> creating a C list head on the rust side must guarantee that it is not >> modified. >> Since rust has no visibility on the C side, I believe it is a Rust invariant >> here that the existence of CListHead assumes that the list cannot be modified >> once Rust has access over it. That is up to the creator (user) of the >> CListHead >> to guarantee. In the DRM buddy case, once the list is allocated and >> accessible >> from Rust, C code will not modify it while the Rust object exists. >> >> Does that make sense, or is there a better way to document this? >> >> -- >> Joel Fernandes > > > In which case, I recommend moving this to a safety requirement when > creating the list. Ok, will do. > I assume the purpose of not modifying the list on the C side is to avoid > corrupting the list in Rust somehow? Yes. Thanks, -- Joel Fernandes
- [PATCH -next v7 2/2] rust: gpu: Add GPU buddy allocator b... Joel Fernandes
- [PATCH -next v7 1/2] rust: clist: Add support to interfac... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Add support to... Daniel Almeida
- Re: [PATCH -next v7 1/2] rust: clist: Add suppor... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Add su... Gary Guo
- Re: [PATCH -next v7 1/2] rust: clist: Ad... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Add suppor... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Add su... Daniel Almeida
- Re: [PATCH -next v7 1/2] rust: clist: Ad... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clis... Daniel Almeida
- Re: [PATCH -next v7 1/2] rust: ... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Add support to... Gary Guo
- Re: [PATCH -next v7 1/2] rust: clist: Add suppor... Danilo Krummrich
- Re: [PATCH -next v7 1/2] rust: clist: Add su... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: clist: Ad... Gary Guo
- Re: [PATCH -next v7 1/2] rust: clis... Danilo Krummrich
- Re: [PATCH -next v7 1/2] rust: ... Gary Guo
- Re: [PATCH -next v7 1/2] rust: ... Danilo Krummrich
- Re: [PATCH -next v7 1/2] rust: ... Daniel Almeida
- Re: [PATCH -next v7 1/2] rust: ... Joel Fernandes
- Re: [PATCH -next v7 1/2] rust: ... Joel Fernandes
