Home
last modified time | relevance | path

Searched refs:Box (Results 1 – 25 of 56) sorted by relevance

123

/linux/rust/kernel/alloc/
H A Dkbox.rs3 //! Implementation of [`Box`].
48 /// The kernel's [`Box`] type -- a heap allocation for a single value of type `T`.
50 /// This is the kernel's version of the Rust stdlib's `Box`. There are several differences,
51 /// for example no `noalias` attribute is emitted and partially moving out of a `Box` is not
52 /// supported. There are also several API differences, e.g. `Box` always requires an [`Allocator`]
56 /// `Box` works with any of the kernel's allocators, e.g. [`Kmalloc`], [`Vmalloc`] or [`KVmalloc`].
57 /// There are aliases for `Box` with these allocators ([`KBox`], [`VBox`], [`KVBox`]).
59 /// When dropping a [`Box`], the value is also dropped and the heap memory is automatically freed.
86 /// [`Box`]es can also be used to store trait objects by coercing their type:
104 pub struct Box<#[pointe
81 pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?Sized, A: Allocator>( global() struct
89 impl<T, U, A> core::ops::CoerceUnsized<Box<U, A>> for Box<T, A> global() implementation
100 impl<T, U, A> core::ops::DispatchFromDyn<Box<U, A>> for Box<T, A> global() implementation
146 unsafe impl<T, A: Allocator> ZeroableOption for Box<T, A> {} global() implementation
149 unsafe impl<T, A> Send for Box<T, A> global() implementation
157 unsafe impl<T, A> Sync for Box<T, A> global() implementation
164 impl<T, A> Box<T, A> global() implementation
218 impl<T, A> Box<MaybeUninit<T>, A> global() implementation
248 impl<T, A> Box<T, A> global() implementation
433 impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A> global() implementation
458 impl<T, A> InPlaceInit<T> for Box<T, A> global() implementation
483 unsafe impl<T: 'static, A> ForeignOwnable for Box<T, A> global() implementation
565 impl<T, A> Deref for Box<T, A> global() implementation
579 impl<T, A> DerefMut for Box<T, A> global() implementation
609 impl<T, A> Borrow<T> for Box<T, A> global() implementation
637 impl<T, A> BorrowMut<T> for Box<T, A> global() implementation
647 impl<T, A> fmt::Display for Box<T, A> global() implementation
657 impl<T, A> fmt::Debug for Box<T, A> global() implementation
667 impl<T, A> Drop for Box<T, A> global() implementation
[all...]
H A Dallocator.rs187 /// // SAFETY: By the type invariant of `Box` the inner pointer of `vbox` is non-null.
289 struct TestAlign<T, A: Allocator>(Box<MaybeUninit<T>, A>); in test_alignment()
292 Ok(Self(Box::<_, A>::new_uninit(GFP_KERNEL)?)) in test_alignment()
/linux/rust/syn/
H A Dlit.rs61 repr: Box<LitRepr>,
68 repr: Box<LitRepr>,
75 repr: Box<LitRepr>,
82 repr: Box<LitRepr>,
89 repr: Box<LitRepr>,
95 suffix: Box<str>,
101 repr: Box<LitIntRepr>,
107 digits: Box<str>,
108 suffix: Box<str>,
116 repr: Box<LitFloatRepr>,
[all …]
H A Dexpr.rs286 pub left: Box<Expr>,
288 pub right: Box<Expr>,
308 pub base: Box<Expr>,
319 pub left: Box<Expr>,
321 pub right: Box<Expr>,
343 pub expr: Option<Box<Expr>>,
352 pub func: Box<Expr>,
363 pub expr: Box<Expr>,
365 pub ty: Box<Type>,
383 pub body: Box<Expr>,
[all …]
H A Dpunctuated.rs51 last: Option<Box<T>>,
123 inner: Box::new(NoDrop::new(PrivateIter { in iter()
125 last: self.last.as_ref().map(Box::as_ref).into_iter(), in iter()
134 inner: Box::new(NoDrop::new(PrivateIterMut { in iter_mut()
136 last: self.last.as_mut().map(Box::as_mut).into_iter(), in iter_mut()
146 last: self.last.as_ref().map(Box::as_ref).into_iter(), in pairs()
155 last: self.last.as_mut().map(Box::as_mut).into_iter(), in pairs_mut()
186 self.last = Some(Box::new(value)); in push_value()
223 self.last = Some(Box::new(t)); in pop_punct()
511 punctuated.last = Some(Box::new(a)); in do_extend()
[all …]
H A Dpat.rs117 pub subpat: Option<(Token![@], Box<Pat>)>,
137 pub pat: Box<Pat>,
148 pub pat: Box<Pat>,
211 pub pat: Box<Pat>,
213 pub ty: Box<Type>,
236 pub pat: Box<Pat>,
392 pat: Box::new(Pat::parse_single(input)?), in parse()
487 Some((at_token, Box::new(subpat))) in pat_ident()
577 pat: Box::new(Pat::parse_multi_with_leading_vert(input)?), in field_pat()
602 pat: Box::new(pat), in field_pat()
[all …]
H A Dty.rs99 pub elem: Box<Type>,
125 pub elem: Box<Type>,
168 pub elem: Box<Type>,
189 pub elem: Box<Type>,
200 pub elem: Box<Type>,
209 pub elem: Box<Type>,
271 Type(Token![->], Box<Type>),
355 group.elem = Box::new(Type::Path(ty)); in ambig_ty()
393 elem: Box::new(Type::TraitObject(content.parse()?)), in ambig_ty()
500 elem: Box::new(first), in ambig_ty()
[all …]
H A Drestriction.rs37 pub path: Box<Path>,
119 path: Box::new(Path::from(path)), in parse_pub()
131 path: Box::new(path), in parse_pub()
H A Dstmt.rs63 pub expr: Box<Expr>,
64 pub diverge: Option<(Token![else], Box<Expr>)>,
294 pat: Box::new(pat), in stmt_local()
296 ty: Box::new(ty), in stmt_local()
311 Some((else_token, Box::new(Expr::Block(diverge)))) in stmt_local()
318 expr: Box::new(expr), in stmt_local()
H A Dparse_quote.rs218 impl ParseQuote for Box<Pat> { implementation
220 <Pat as ParseQuote>::parse(input).map(Box::new) in parse()
/linux/rust/pin-init/src/
H A Dalloc.rs4 use alloc::{boxed::Box, sync::Arc};
22 unsafe impl<T> ZeroableOption for Box<T> {} implementation
82 impl<T> InPlaceInit<T> for Box<T> { in try_pin_init()
88 try_new_uninit!(Box).write_pin_init(init)
96 try_new_uninit!(Box).write_init(init)
138 impl<T> InPlaceWrite<T> for Box<MaybeUninit<T>> {
139 type Initialized = Box<T>; in write_init()
80 impl<T> InPlaceInit<T> for Box<T> { global() implementation
136 impl<T> InPlaceWrite<T> for Box<MaybeUninit<T>> { global() implementation
/linux/drivers/virt/vboxguest/
H A DKconfig3 tristate "Virtual Box Guest integration support"
7 This is a driver for the Virtual Box Guest PCI device used in
8 Virtual Box virtual machines. Enabling this driver will add
9 support for Virtual Box Guest integration features such as
/linux/Documentation/ABI/testing/
H A Dsysfs-driver-intel_sdsi4 Contact: "David E. Box" <david.e.box@linux.intel.com>
33 Contact: "David E. Box" <david.e.box@linux.intel.com>
43 Contact: "David E. Box" <david.e.box@linux.intel.com>
54 Contact: "David E. Box" <david.e.box@linux.intel.com>
63 Contact: "David E. Box" <david.e.box@linux.intel.com>
75 Contact: "David E. Box" <david.e.box@linux.intel.com>
85 Contact: "David E. Box" <david.e.box@linux.intel.com>
H A Dsysfs-class-intel_pmt4 Contact: David Box <david.e.box@linux.intel.com>
13 Contact: David Box <david.e.box@linux.intel.com>
26 Contact: David Box <david.e.box@linux.intel.com>
34 Contact: David Box <david.e.box@linux.intel.com>
43 Contact: David Box <david.e.box@linux.intel.com>
51 Contact: David Box <david.e.box@linux.intel.com>
72 Contact: David Box <david.e.box@linux.intel.com>
H A Dsysfs-platform-brcmstb-gisb-arb7 Broadcom Set Top Box internal GISB bus arbiter. Minimum value
/linux/rust/kernel/debugfs/
H A Dtraits.rs101 // Delegate for `Box<T, A>`: Support a `Box<T, A>` with no lock or an inner lock.
102 impl<T, A> BinaryWriter for Box<T, A>
116 // Delegate for `Pin<Box<T, A>>`: Support a `Pin<Box<T, A>>` with no lock or an inner lock.
117 impl<T, A> BinaryWriter for Pin<Box<T, A>> in write_to_slice()
235 // Delegate for `Box<T, A>`: Support a `Box<T, A>` with an outer lock.
236 impl<T: ?Sized + BinaryReaderMut, A: Allocator> BinaryReaderMut for Box<T, A> {
290 // Delegate for `Box<
83 impl<T, A> BinaryWriter for Box<T, A> global() implementation
224 impl<T: ?Sized + BinaryReaderMut, A: Allocator> BinaryReaderMut for Box<T, A> { global() implementation
289 impl<T: ?Sized + BinaryReader, A: Allocator> BinaryReader for Box<T, A> { global() implementation
[all...]
/linux/rust/pin-init/examples/
H A Dbig_struct_in_place.rs32 let buf: Box<BigStruct> = Box::init(init!(BigStruct { in main()
H A Dlinked_list.rs149 let a = Box::pin_init(ListHead::new())?;
153 let e = Box::pin_init(ListHead::insert_next(&b))?; in main()
/linux/rust/syn/gen/
H A Dfold.rs1064 guard: (node.guard).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))), in fold_arm()
1066 body: Box::new(f.fold_expr(*node.body)), in fold_arm()
1460 left: Box::new(f.fold_expr(*node.left)), in fold_expr_assign()
1462 right: Box::new(f.fold_expr(*node.right)), in fold_expr_assign()
1486 base: Box::new(f.fold_expr(*node.base)), in fold_expr_await()
1499 left: Box::new(f.fold_expr(*node.left)), in fold_expr_binary()
1501 right: Box::new(f.fold_expr(*node.right)), in fold_expr_binary()
1526 expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))), in fold_expr_break()
1537 func: Box::new(f.fold_expr(*node.func)), in fold_expr_call()
1550 expr: Box::new(f.fold_expr(*node.expr)), in fold_expr_cast()
[all …]
/linux/rust/proc-macro2/
H A Ddetection.rs64 let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ }); in initialize()
/linux/drivers/platform/x86/amd/
H A DKconfig38 tristate "AMD Halo Box RGB LED Driver"
41 This driver provides RGB LED control for AMD Halo Box devices
42 through the LED multicolor subsystem. The Halo Box light bar can
/linux/rust/pin-init/
H A DREADME.md52 will require the `std` feature, because stable compilers have neither `Box` nor `Arc` in no-std
66 [`Box<T>`] or any other smart pointer that supports this library).
112 let foo: Result<Pin<Box<Foo>>, AllocError> = Box::pin_init(foo);
133 buffer: Box<[u8; 1_000_000]>,
140 buffer: Box::init(pin_init::init_zeroed())?,
247 [`Box<T>`]: https://doc.rust-lang.org/stable/alloc/boxed/struct.Box.html
/linux/rust/zerocopy/src/
H A Dimpls.rs306 T: Sized => Immutable for Box<T>
336 T => TryFromBytes for Option<Box<T>>; |c| pointer::is_zeroed(c)
341 T => FromZeros for Option<Box<T>>
1401 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(f: F); in test_impls()
1406 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(f: F) { in test_impls()
1419 f(Box::new(ffs)); in test_impls()
1429 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(f: F) { in test_impls()
1431 f(Box::new(ReadOnly::new(None))); in test_impls()
1469 fn with_passing_test_cases<F: Fn(Box<ReadOnly<Self>>)>(_f: F) { in test_impls()
1471 let bx = Box::<Self>::from($success_case); in test_impls()
[all …]
/linux/rust/zerocopy-derive/
H A Dutil.rs306 variant_id: Box<Expr>,
307 field: Box<Type>,
308 field_id: Box<Expr>,
311 variant_id: Box<Expr>,
312 field: Box<Type>,
313 field_id: Box<Expr>,
314 invariants: Box<Type>,
/linux/rust/zerocopy-derive/derive/
H A Dtry_from_bytes.rs232 let field: Box<syn::Type> = parse_quote!(()); in derive_is_bit_valid()
467 let variant_id: Box<Expr> = match &ctx.ast.data { in derive_has_field_struct_union()
491 let field: Box<Type> = parse_quote!(#field_token); in derive_has_field_struct_union()
492 let field_id: Box<Expr> = parse_quote!({ #zerocopy_crate::ident_id!(#ident) }); in derive_has_field_struct_union()
606 let variant_id: Box<Expr> = { in derive_try_from_bytes_union()

123