unsafe fn dealloc_array<T>(&mut self, ptr: NonNull<T>, n: usize) -> Result<(), AllocErr>
        where Self: Sized
    {
        match Layout::array::<T>(n) {
            Ok(ref k) if k.size() > 0 => {
                Ok(self.dealloc(ptr.cast(), k.clone()))
            }
            _ => {
                Err(AllocErr)
            }
        }
    }
/// Deallocates a block suitable for holding `n` instances of `T`.
///
/// Captures a common usage pattern for allocators.
///
/// # Safety
///
/// This function is unsafe because undefined behavior can result
/// if the caller does not ensure both:
///
/// * `ptr` must denote a block of memory currently allocated via this allocator
///
/// * the layout of `[T; n]` must *fit* that block of memory.
///
/// # Errors
///
/// Returning `Err` indicates that either `[T; n]` or the given
/// memory block does not meet allocator's size or alignment
/// constraints.
///
/// Always returns `Err` on arithmetic overflow.
Deallocates a block suitable for holding `n` instances of `T`.
Captures a common usage pattern for allocators.
Deallocates a block suitable for holding ` n ` instances of ` T ` . Captures a common usage pattern for allocators .
unsafe fn dealloc_array<T>(&mut self, ptr: NonNull<T>, n: usize) -> Result<(), AllocErr>
        where Self: Sized
    {
        match Layout::array::<T>(n) {
            Ok(ref k) if k.size() > 0 => {
                Ok(self.dealloc(ptr.cast(), k.clone()))
            }
            _ => {
                Err(AllocErr)
            }
        }
    }
unsafe fn dealloc_array < T > ( & mut self , ptr : NonNull < T > , n : usize ) -> Result < ( ) , AllocErr > where Self : Sized { match Layout :: array :: < T > ( n ) { Ok ( ref k ) if k . size ( ) > 0 => { Ok ( self . dealloc ( ptr . cast ( ) , k . clone ( ) ) ) } _ => { Err ( AllocErr ) } } }
Deallocates a block suitable for holding `n` instances of `T`.
Deallocates a block suitable for holding ` n ` instances of ` T ` .
&mut self
ptr
NonNull<T>
n
usize
&mut self
ptr
NonNull<T>
n
usize
safety
This function is unsafe because undefined behavior can result
if the caller does not ensure both.

`ptr` must denote a block of memory currently allocated via this allocator

the layout of `[T; n]` must *fit* that block of memory.
This function is unsafe because undefined behavior can result if the caller does not ensure both . ` ptr ` must denote a block of memory currently allocated via this allocator the layout of ` [ T ; n ] ` must * fit * that block of memory .
errors
Returning `Err` indicates that either `[T; n]` or the given
memory block does not meet allocator's size or alignment
constraints.

Always returns `Err` on arithmetic overflow.
Returning ` Err ` indicates that either ` [ T ; n ] ` or the given memory block does not meet allocator ' s size or alignment constraints . Always returns ` Err ` on arithmetic overflow .