[PATCH RFC] rust: maple_tree: implement Send and Sync for MapleTree

Daniel Almeida daniel.almeida at collabora.com
Mon Apr 20 15:00:42 PDT 2026


Hi Joel,

I think there are others in a better position to review this than me, 
however, while reading this patch, I noticed this:
> 
>     #[inline]
> @@ -302,19 +305,31 @@ fn drop(mut self: Pin<&mut Self>) {
>     }
> }
> 
> +// SAFETY: `MapleTree<T>` is `Send` iff `T` is `Send`.  All access to the tree
> +// goes through the internal `ma_lock` spinlock or via `&mut MapleTree`.
> +unsafe impl<T: ForeignOwnable + Send> Send for MapleTree<T> {}
> +// SAFETY: All shared access through `&MapleTree` either acquires `ma_lock`.

^ Missing something here? Either … or? 

— Daniel


More information about the maple-tree mailing list