rust: sync: add `Arc` for ref-counted allocations
This is a basic implementation of `Arc` backed by C's `refcount_t`. It allows Rust code to idiomatically allocate memory that is ref-counted. Cc: Will Deacon <will@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by:Wedson Almeida Filho <wedsonaf@gmail.com> Reviewed-by:
Alice Ryhl <aliceryhl@google.com> Reviewed-by:
Gary Guo <gary@garyguo.net> Reviewed-by:
Vincenzo Palazzo <vincenzopalazzodev@gmail.com> Acked-by:
Boqun Feng <boqun.feng@gmail.com> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
Showing
- rust/bindings/bindings_helper.h 1 addition, 0 deletionsrust/bindings/bindings_helper.h
- rust/bindings/lib.rs 1 addition, 0 deletionsrust/bindings/lib.rs
- rust/helpers.c 19 additions, 0 deletionsrust/helpers.c
- rust/kernel/lib.rs 1 addition, 0 deletionsrust/kernel/lib.rs
- rust/kernel/sync.rs 10 additions, 0 deletionsrust/kernel/sync.rs
- rust/kernel/sync/arc.rs 157 additions, 0 deletionsrust/kernel/sync/arc.rs
Loading
Please register or sign in to comment