unsafe fn realloc_excess(&mut self,
                             ptr: NonNull<u8>,
                             layout: Layout,
                             new_size: usize) -> Result<Excess, AllocErr> {
        let new_layout = Layout::from_size_align_unchecked(new_size, layout.align());
        let usable_size = self.usable_size(&new_layout);
        self.realloc(ptr, layout, new_size)
            .map(|p| Excess(p, usable_size.1))
    }
/// Behaves like `realloc`, but also returns the whole size of
/// the returned block. For some `layout` inputs, like arrays, this
/// may include extra storage usable for additional data.
///
/// # Safety
///
/// This function is unsafe for the same reasons that `realloc` is.
///
/// # Errors
///
/// Returning `Err` indicates that either memory is exhausted or
/// `layout` does not meet allocator's size or alignment
/// constraints, just as in `realloc`.
///
/// Clients wishing to abort computation in response to a
/// reallocation error are encouraged to call the [`handle_alloc_error`] function,
/// rather than directly invoking `panic!` or similar.
///
/// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
Behaves like `realloc`, but also returns the whole size of
the returned block. For some `layout` inputs, like arrays, this
may include extra storage usable for additional data.
Behaves like ` realloc ` but also returns the whole size of the returned block . For some ` layout ` inputs like arrays this may include extra storage usable for additional data .
unsafe fn realloc_excess(&mut self,
                             ptr: NonNull<u8>,
                             layout: Layout,
                             new_size: usize) -> Result<Excess, AllocErr> {
        let new_layout = Layout::from_size_align_unchecked(new_size, layout.align());
        let usable_size = self.usable_size(&new_layout);
        self.realloc(ptr, layout, new_size)
            .map(|p| Excess(p, usable_size.1))
    }
unsafe fn realloc_excess ( & mut self , ptr : NonNull < u8 > , layout : Layout , new_size : usize ) -> Result < Excess , AllocErr > { let new_layout = Layout :: from_size_align_unchecked ( new_size , layout . align ( ) ) ; let usable_size = self . usable_size ( & new_layout ) ; self . realloc ( ptr , layout , new_size ) . map ( | p | Excess ( p , usable_size . 1 ) ) }
Behaves like `realloc`, but also returns the whole size of
the returned block.
Behaves like ` realloc ` but also returns the whole size of the returned block .
&mut self
ptr
NonNull<u8>
layout
Layout
new_size
usize
&mut self
ptr
NonNull<u8>
layout
Layout
new_size
usize
safety
This function is unsafe for the same reasons that `realloc` is.
This function is unsafe for the same reasons that ` realloc ` is .
errors
Returning `Err` indicates that either memory is exhausted or
`layout` does not meet allocator's size or alignment
constraints, just as in `realloc`.

Clients wishing to abort computation in response to a
reallocation error are encouraged to call the [`handle_alloc_error`] function,
rather than directly invoking `panic!` or similar.

[`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
Returning ` Err ` indicates that either memory is exhausted or ` layout ` does not meet allocator ' s size or alignment constraints just as in ` realloc ` . Clients wishing to abort computation in response to a reallocation error are encouraged to call the [ ` handle_alloc_error ` ] function rather than directly invoking ` panic! ` or similar . [ ` handle_alloc_error ` ] : .. / .. / alloc / alloc / fn . handle_alloc_error . html