Home
last modified time | relevance | path

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

/rust/kernel/alloc/
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()
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()
A Dkvec.rs8 AllocError, Allocator, Box, Flags,
312 pub fn push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> { in push() argument
488 pub fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> { in with_capacity() argument
609 pub fn reserve(&mut self, additional: usize, flags: Flags) -> Result<(), AllocError> { in reserve() argument
619 return Err(AllocError); in reserve()
624 let new_cap = core::cmp::max(cap * 2, len.checked_add(additional).ok_or(AllocError)?); in reserve()
625 let layout = ArrayLayout::new(new_cap).map_err(|_| AllocError)?; in reserve()
726 pub fn extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> { in extend_with() argument
765 pub fn extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> { in extend_from_slice() argument
781 pub fn from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> { in from_elem() argument
[all …]
A Dkbox.rs7 use super::{AllocError, Allocator, Flags};
255 pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
274 pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> { in new_uninit() argument
286 pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError> in pin()
389 E: From<AllocError>, in try_pin_init() argument
397 E: From<AllocError>, in try_init() argument
/rust/pin-init/src/
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
/rust/pin-init/examples/
A Derror.rs8 use std::alloc::AllocError;
20 impl From<AllocError> for Error {
21 fn from(_: AllocError) -> Self { in from()
A Dpthread_mutex.rs11 use core::alloc::AllocError;
58 impl From<AllocError> for Error {
59 fn from(_: AllocError) -> Self { in from()
/rust/kernel/
A Dcpumask.rs8 alloc::{AllocError, Flags},
224 pub fn new_zero(_flags: Flags) -> Result<Self, AllocError> { in new_zero() argument
235 NonNull::new(ptr.cast()).ok_or(AllocError)? in new_zero()
249 pub unsafe fn new(_flags: Flags) -> Result<Self, AllocError> { in new() argument
260 NonNull::new(ptr.cast()).ok_or(AllocError)? in new()
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
A Dinit.rs130 alloc::{AllocError, Flags},
149 E: From<AllocError>; in try_pin_init() argument
169 E: From<AllocError>; in try_init() argument
A Dpage.rs6 alloc::{AllocError, Flags},
73 pub fn alloc_page(flags: Flags) -> Result<Self, AllocError> { in alloc_page() argument
77 let page = NonNull::new(page).ok_or(AllocError)?; in alloc_page()
A Derror.rs8 alloc::{layout::LayoutError, AllocError},
199 impl From<AllocError> for Error {
200 fn from(_: AllocError) -> Error { in from()
A Dstr.rs5 use crate::alloc::{flags::*, AllocError, KVec};
389 pub fn to_cstring(&self) -> Result<CString, AllocError> { in to_cstring() argument
432 pub fn to_ascii_lowercase(&self) -> Result<CString, AllocError> { in to_ascii_lowercase() argument
449 pub fn to_ascii_uppercase(&self) -> Result<CString, AllocError> { in to_ascii_uppercase() argument
946 type Error = AllocError;
948 fn try_from(cstr: &'a CStr) -> Result<CString, AllocError> { in try_from() argument
A Dworkqueue.rs189 alloc::{AllocError, Flags},
338 ) -> Result<(), AllocError> { in try_spawn() argument
344 self.enqueue(KBox::pin_init(init, flags).map_err(|_| AllocError)?); in try_spawn()
/rust/kernel/sync/
A Darc.rs20 alloc::{AllocError, Flags, KBox},
213 E: From<AllocError>, in try_pin_init() argument
221 E: From<AllocError>, in try_init() argument
229 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
728 E: From<AllocError>, in try_pin_init() argument
736 E: From<AllocError>, in try_init() argument
766 pub fn new(value: T, flags: Flags) -> Result<Self, AllocError> { in new() argument
774 pub fn new_uninit(flags: Flags) -> Result<UniqueArc<MaybeUninit<T>>, AllocError> { in new_uninit() argument
776 let inner = KBox::try_init::<AllocError>( in new_uninit()
780 data <- pin_init::uninit::<T, AllocError>(), in new_uninit()
[all …]
/rust/kernel/list/
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
/rust/pin-init/
A DREADME.md100 let foo: Result<Pin<Box<Foo>>, AllocError> = Box::pin_init(foo);

Completed in 29 milliseconds