std::alloc::alloc
pub unsafe fn alloc(layout: Layout) -> *mut u8
- Kind
- function
- Module
std::alloc- Since
- 1.28.0
Source: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
The entries of std::alloc in the Rust reference. This page has 46 cards.
pub unsafe fn alloc(layout: Layout) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub unsafe trait Allocator
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
fn by_ref(&self) -> &Self where Self: Sized
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout)
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn grow( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn grow_zeroed( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn shrink( &self, ptr: NonNull<u8>, old_layout: Layout, new_layout: Layout, ) -> Result<NonNull<[u8]>, AllocError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub struct AllocError
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub unsafe fn dealloc(ptr: *mut u8, layout: Layout)
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub struct Global
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub unsafe trait GlobalAlloc
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn alloc(&self, layout: Layout) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
unsafe fn realloc( &self, ptr: *mut u8, layout: Layout, new_size: usize, ) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub fn handle_alloc_error(layout: Layout) -> !
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub struct Layout
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn adjust_alignment_to( &self, alignment: Alignment, ) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn align(&self) -> usize
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn align_to(&self, align: usize) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn alignment(&self) -> Alignment
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn array<T>(n: usize) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn dangling_ptr(&self) -> NonNull<u8>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn for_value<T>(t: &T) -> Layout where T: ?Sized
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const unsafe fn for_value_raw<T>(t: *const T) -> Layout where T: ?Sized
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn from_size_align( size: usize, align: usize, ) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const unsafe fn from_size_align_unchecked( size: usize, align: usize, ) -> Layout
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn from_size_alignment( size: usize, alignment: Alignment, ) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const unsafe fn from_size_alignment_unchecked( size: usize, alignment: Alignment, ) -> Layout
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn new<T>() -> Layout
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn pad_to_align(&self) -> Layout
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn padding_needed_for(&self, alignment: Alignment) -> usize
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutError>
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub const fn size(&self) -> usize
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub type LayoutErr = LayoutError;
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
#[non_exhaustive]pub struct LayoutError
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub fn set_alloc_error_hook(hook: fn(Layout))
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub struct System
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.
pub fn take_alloc_error_hook() -> fn(Layout)
std::allocSource: doc.rust-lang.org, doc.rust-lang.org. JSON record. This entry is a card. Help write this page.