about summary refs log tree commit diff
path: root/src/lib/ptr.rs
blob: b230a61e966fb06541e9f1fcf5ae24cc73c4a6e9 (plain)
1
2
3
4
5
6
7
8
9
10
// Unsafe pointer utility functions.

native "rust-intrinsic" mod rusti {
    fn addr_of[T](&mutable T val) -> *mutable T;
    fn ptr_offset[T](*T ptr, uint count) -> *T;
}

fn addr_of[T](&mutable T val) -> *mutable T { ret rusti::addr_of(val); }
fn offset[T](*T ptr, uint count) -> *T { ret rusti::ptr_offset(ptr, count); }