std.ptr
pointer <-> address and alignment math (Fels has no pointer arithmetic)
to_addr
Section titled “to_addr”pub to_addr :: fn($T: type, p: *T) -> usizeaddress of p
from_addr
Section titled “from_addr”pub from_addr :: fn($T: type, addr: usize) -> *Taddress -> *T; unsafe: caller ensures it is valid and aligned for T
is_null
Section titled “is_null”pub is_null :: fn($T: type, p: *T) -> booladd_bytes
Section titled “add_bytes”pub add_bytes :: fn(addr: usize, offset: usize) -> usizeaddr + offset bytes
sub_bytes
Section titled “sub_bytes”pub sub_bytes :: fn(addr: usize, offset: usize) -> usizeaddr - offset bytes
diff_bytes
Section titled “diff_bytes”pub diff_bytes :: fn($T: type, a: *T, b: *T) -> isizea - b in bytes; negative when a comes first
is_aligned
Section titled “is_aligned”pub is_aligned :: fn(addr: usize, alignment: usize) -> boolalign_down
Section titled “align_down”pub align_down :: fn(addr: usize, alignment: usize) -> usizealign_up
Section titled “align_up”pub align_up :: fn(addr: usize, alignment: usize) -> usize