Home
last modified time | relevance | path

Searched refs:AllocError (Results 1 – 16 of 16) sorted by relevance

/linux-6.15/rust/pin-init/src/
H A Dalloc.rs6 use core::alloc::AllocError;
12 type AllocError = core::convert::Infallible; typedef
32 E: From<AllocError>; in try_pin_init() argument
38 fn pin_init(init: impl PinInit<T>) -> Result<Pin<Self>, AllocError> { in pin_init() argument
52 E: From<AllocError>; in try_init() argument
55 fn init(init: impl Init<T>) -> Result<Self, AllocError> { in init() argument
84 E: From<AllocError>, in try_pin_init() argument
92 E: From<AllocError>, in try_init() argument
102 E: From<AllocError>, in try_pin_init() argument
120 E: From<AllocError>, in try_init() argument
/linux-6.15/rust/kernel/alloc/
H A Dallocator.rs16 use crate::alloc::{AllocError, Allocator};
90 ) -> Result<NonNull<[u8]>, AllocError> { in call() argument
119 NonNull::new(raw_ptr).ok_or(AllocError)? in call()
137 ) -> Result<NonNull<[u8]>, AllocError> { in realloc() argument
154 ) -> Result<NonNull<[u8]>, AllocError> { in realloc() argument
158 return Err(AllocError); in realloc()
178 ) -> Result<NonNull<[u8]>, AllocError> { in realloc() argument
182 return Err(AllocError); in realloc()
H A Dallocator_test.rs12 use super::{flags::*, AllocError, Allocator, Flags};
43 ) -> Result<NonNull<[u8]>, AllocError> { in realloc() argument
80 let layout = layout.align_to(min_align).map_err(|_| AllocError)?; in realloc()
86 let dst = NonNull::new(dst).ok_or(AllocError)?; in realloc()
H A Dkvec.rs11 AllocError, Allocator, Box, Flags,
288 pub fn push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> { in push() argument
318 pub fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> { in with_capacity() argument
419 pub fn reserve(&mut self, additional: usize, flags: Flags) -> Result<(), AllocError> { in reserve() argument
429 return Err(AllocError); in reserve()
434 let new_cap = core::cmp::max(cap * 2, len.checked_add(additional).ok_or(AllocError)?); in reserve()
435 let layout = ArrayLayout::new(new_cap).map_err(|_| AllocError)?; in reserve()
462 pub fn extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> { in extend_with() argument
501 pub fn extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> { in extend_from_slice() argument
517 pub fn from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> { in from_elem() argument
H A Dkbox.rs7 use super::{AllocError, Allocator, Flags};
215 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
234 pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> { in new_uninit() argument
246 pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> in pin()
349 E: From<AllocError>, in try_pin_init() argument
357 E: From<AllocError>, in try_init() argument
/linux-6.15/rust/pin-init/examples/
H A Derror.rs8 use std::alloc::AllocError;
20 impl From<AllocError> for Error {
21 fn from(_: AllocError) -> Self { in from()
H A Dpthread_mutex.rs9 use core::alloc::AllocError;
55 impl From<AllocError> for Error {
56 fn from(_: AllocError) -> Self { in from()
/linux-6.15/rust/kernel/sync/
H A Darc.rs20 alloc::{AllocError, Flags, KBox},
211 E: From<AllocError>, in try_pin_init() argument
219 E: From<AllocError>, in try_init() argument
227 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
697 E: From<AllocError>, in try_pin_init() argument
705 E: From<AllocError>, in try_init() argument
735 pub fn new(value: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
743 pub fn new_uninit(flags: Flags) -> Result<UniqueArc<MaybeUninit<T>>, AllocError> { in new_uninit() argument
745 let inner = KBox::try_init::<AllocError>( in new_uninit()
749 data <- pin_init::uninit::<T, AllocError>(), in new_uninit()
[all …]
/linux-6.15/rust/kernel/
H A Dinit.rs138 alloc::{AllocError, Flags},
157 E: From<AllocError>; in try_pin_init() argument
177 E: From<AllocError>; in try_init() argument
H A Dalloc.rs30 pub struct AllocError; struct
156 fn alloc(layout: Layout, flags: Flags) -> Result<NonNull<[u8]>, AllocError> { in alloc() argument
199 ) -> Result<NonNull<[u8]>, AllocError>; in realloc() argument
H A Dpage.rs6 alloc::{AllocError, Flags},
72 pub fn alloc_page(flags: Flags) -> Result<Self, AllocError> { in alloc_page() argument
76 let page = NonNull::new(page).ok_or(AllocError)?; in alloc_page()
H A Dstr.rs5 use crate::alloc::{flags::*, AllocError, KVec};
358 pub fn to_cstring(&self) -> Result<CString, AllocError> { in to_cstring() argument
401 pub fn to_ascii_lowercase(&self) -> Result<CString, AllocError> { in to_ascii_lowercase() argument
418 pub fn to_ascii_uppercase(&self) -> Result<CString, AllocError> { in to_ascii_uppercase() argument
925 type Error = AllocError;
927 fn try_from(cstr: &'a CStr) -> Result<CString, AllocError> { in try_from() argument
H A Derror.rs8 alloc::{layout::LayoutError, AllocError},
198 impl From<AllocError> for Error {
199 fn from(_: AllocError) -> Error { in from()
H A Dworkqueue.rs136 use crate::alloc::{AllocError, Flags};
216 ) -> Result<(), AllocError> { in try_spawn() argument
222 self.enqueue(KBox::pin_init(init, flags).map_err(|_| AllocError)?); in try_spawn()
/linux-6.15/rust/kernel/list/
H A Darc.rs7 use crate::alloc::{AllocError, Flags};
173 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
185 E: From<AllocError>, in pin_init() argument
196 E: From<AllocError>, in init() argument
/linux-6.15/rust/pin-init/
H A DREADME.md94 let foo: Result<Pin<Box<Foo>>, AllocError> = Box::pin_init(foo);