nstd_core_mem_dangling

Function nstd_core_mem_dangling 

Source
#[unsafe(no_mangle)]
pub const extern "C" fn nstd_core_mem_dangling() -> NSTDAny
Available on crate feature core only.
Expand description

Creates a new dangling pointer to some immutable memory. The pointer is guaranteed to have valid alignment for any scalar type.

§Returns

NSTDAny dangling - The new dangling raw pointer.

§Example

use nstd_sys::core::{mem::nstd_core_mem_dangling, slice::nstd_core_slice_new};

let slice = unsafe { nstd_core_slice_new(nstd_core_mem_dangling(), 1, 1, 0).unwrap() };