[−][src]Trait alloc_wg::alloc::AllocRef
Associated Types
type Error
Required methods
Loading content...Provided methods
fn alloc_zeroed(
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>
fn usable_size(&self, layout: NonZeroLayout) -> (usize, usize)
unsafe fn grow_in_place(
&mut self,
ptr: NonNull<u8>,
layout: NonZeroLayout,
new_size: NonZeroUsize
) -> bool
&mut self,
ptr: NonNull<u8>,
layout: NonZeroLayout,
new_size: NonZeroUsize
) -> bool
Safety
ptrmust be currently allocated via this allocatorlayoutmust fit theptr(see above); note thenew_sizeargument need not fit itnew_sizemust not be less thanlayout.size()
unsafe fn shrink_in_place(
&mut self,
ptr: NonNull<u8>,
layout: NonZeroLayout,
new_size: NonZeroUsize
) -> bool
&mut self,
ptr: NonNull<u8>,
layout: NonZeroLayout,
new_size: NonZeroUsize
) -> bool
Safety
ptrmust be currently allocated via this allocatorlayoutmust fit theptr(see above); note thenew_sizeargument need not fit itnew_sizemust not be greater thanlayout.size()(and must be greater than zero)
Implementations on Foreign Types
impl AllocRef for System[src]
type Error = AllocErr
fn alloc(&mut self, layout: NonZeroLayout) -> Result<NonNull<u8>, Self::Error>[src]
fn alloc_zeroed(
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>[src]
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>
Implementors
impl AllocRef for Global[src]
type Error = AllocErr
fn alloc(&mut self, layout: NonZeroLayout) -> Result<NonNull<u8>, Self::Error>[src]
fn alloc_zeroed(
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>[src]
&mut self,
layout: NonZeroLayout
) -> Result<NonNull<u8>, Self::Error>