mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
9dc0436550
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>
15 lines
393 B
C
15 lines
393 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Header that contains the code (mostly headers) for which Rust bindings
|
|
* will be automatically generated by `bindgen`.
|
|
*
|
|
* Sorted alphabetically.
|
|
*/
|
|
|
|
#include <linux/slab.h>
|
|
#include <linux/refcount.h>
|
|
|
|
/* `bindgen` gets confused at certain things. */
|
|
const gfp_t BINDINGS_GFP_KERNEL = GFP_KERNEL;
|
|
const gfp_t BINDINGS___GFP_ZERO = __GFP_ZERO;
|