unsafe fn alloc_zeroed(size: usize) -> *mut u8 {
        let (ptr, _, _) = Self::alloc(size);
        if !ptr.is_null() {
            std::ptr::write_bytes(ptr, 0, size);
        }
        ptr
    }
/// Behaves like `alloc`, but also ensures that the contents
/// are set to zero before being returned.
///
/// # Safety
///
/// This function is unsafe for the same reasons that `alloc` is.
/// However the allocated block of memory is guaranteed to be initialized.
///
/// # Errors
///
/// Returning a null pointer indicates that either memory is exhausted
/// or `size` does not meet allocator's size constraints, just as in `alloc`.
///
/// Clients wishing to abort computation in response to an
/// allocation 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 `alloc`, but also ensures that the contents
are set to zero before being returned.
Behaves like ` alloc ` but also ensures that the contents are set to zero before being returned .
unsafe fn alloc_zeroed(size: usize) -> *mut u8 {
        let (ptr, _, _) = Self::alloc(size);
        if !ptr.is_null() {
            std::ptr::write_bytes(ptr, 0, size);
        }
        ptr
    }
unsafe fn alloc_zeroed ( size : usize ) -> * mut u8 { let ( ptr , _ , _ ) = Self :: alloc ( size ) ; if ! ptr . is_null ( ) { std :: ptr :: write_bytes ( ptr , 0 , size ) ; } ptr }
Behaves like `alloc`, but also ensures that the contents
are set to zero before being returned.
Behaves like ` alloc ` but also ensures that the contents are set to zero before being returned .
size
usize
safety
This function is unsafe for the same reasons that `alloc` is.
However the allocated block of memory is guaranteed to be initialized.
This function is unsafe for the same reasons that ` alloc ` is . However the allocated block of memory is guaranteed to be initialized .
errors
Returning a null pointer indicates that either memory is exhausted
or `size` does not meet allocator's size constraints, just as in `alloc`.

Clients wishing to abort computation in response to an
allocation 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 a null pointer indicates that either memory is exhausted or ` size ` does not meet allocator ' s size constraints just as in ` alloc ` . Clients wishing to abort computation in response to an allocation 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