Function std::alloc::alloc_bytes

pub fn alloc_bytes(count: u64) -> raw_ptr 
Expand description

Allocates zeroed memory on the heap in individual bytes.

Arguments

  • count: [u64] - The number of bytes to allocate onto the heap.

Returns

  • [raw_ptr] - The pointer to the newly allocated memory.

Examples

use std::alloc::alloc_bytes;

fn foo() {
    let ptr = alloc_bytes(2);
    assert(!ptr.is_null());
}