Programming Language

Nocter

A self-contained systems language built around simplicity, encapsulation, and foolproof design.

/std/ptr/index.nct

index.nct

//! Nocter raw pointer and address conversion API.
//!
//! Raw pointers are address-carrying values. They do not own memory, do not
//! extend lifetimes, and do not grant dereference permission. These declarations
//! are target-independent core primitives. Operations that project or mutate
//! memory through an address remain package-internal under `std/internal/ptr`.

/// Returns the numeric address carried by a raw pointer.
pub noalloc primitive func addr<T>(pointer: *T): usize

/// Returns the non-owning raw address represented by a readonly borrow.
pub noalloc primitive func from_ref<T>(value: &T): *T

/// Returns the non-owning raw address represented by an exclusive borrow.
pub noalloc primitive func from_ref_mut<T>(value: &+T): *T