diff --git a/src/lib/ptr.rs b/src/lib/ptr.rs index 1654f9188a08..0372b17cdf1d 100644 --- a/src/lib/ptr.rs +++ b/src/lib/ptr.rs @@ -34,6 +34,16 @@ fn offset(ptr: *T, count: uint) -> *T { ret rusti::ptr_offset(ptr, count); } +/* +Function: mut_offset + +Calculate the offset from a mutable pointer +*/ +fn mut_offset(ptr: *mutable T, count: uint) -> *mutable T { + ret rusti::ptr_offset(ptr as *T, count) as *mutable T; +} + + /* Function: null