2011-07-08 23:55:43 -05:00
|
|
|
// Unsafe pointer utility functions.
|
|
|
|
|
|
|
|
native "rust-intrinsic" mod rusti {
|
2011-07-27 10:19:46 -05:00
|
|
|
fn addr_of[T](val: &T) -> *mutable T;
|
2011-07-27 07:19:39 -05:00
|
|
|
fn ptr_offset[T](ptr: *T, count: uint) -> *T;
|
2011-07-08 23:55:43 -05:00
|
|
|
}
|
|
|
|
|
2011-07-27 10:19:46 -05:00
|
|
|
fn addr_of[T](val: &T) -> *mutable T { ret rusti::addr_of(val); }
|
2011-07-27 07:19:39 -05:00
|
|
|
fn offset[T](ptr: *T, count: uint) -> *T {
|
|
|
|
ret rusti::ptr_offset(ptr, count);
|
|
|
|
}
|
2011-07-08 23:55:43 -05:00
|
|
|
|