about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ptr.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/ptr.rs b/src/lib/ptr.rs
index 1654f9188a0..0372b17cdf1 100644
--- a/src/lib/ptr.rs
+++ b/src/lib/ptr.rs
@@ -35,6 +35,16 @@ fn offset<T>(ptr: *T, count: uint) -> *T {
 }
 
 /*
+Function: mut_offset
+
+Calculate the offset from a mutable pointer
+*/
+fn mut_offset<T>(ptr: *mutable T, count: uint) -> *mutable T {
+    ret rusti::ptr_offset(ptr as *T, count) as *mutable T;
+}
+
+
+/*
 Function: null
 
 Create an unsafe null pointer