nstd_core_ptr_new

Function nstd_core_ptr_new 

Source
#[unsafe(no_mangle)]
pub extern "C" fn nstd_core_ptr_new( obj: NSTDAny, size: NSTDUInt, align: NSTDUInt, ) -> NSTDOptionalPtr
Available on crate feature core only.
Expand description

Creates a new instance of NSTDPtr.

§Parameters:

  • NSTDAny obj - The object to point to.

  • NSTDUInt size - The number of bytes that obj’s type occupies.

  • NSTDUInt align - The alignment of the object that obj points to.

§Returns

NSTDOptionalPtr ptr - A new instance of NSTDPtr that points to obj on success, or an uninitialized “none” variant if obj is null or unaligned or if size is greater than NSTDInt’s max value.

§Panics

This operation will panic if align is not a power of two.