Skip to content

Commit 1274b60

Browse files
jwisenikomatsakis
authored andcommitted
---
yaml --- r: 6472 b: refs/heads/master c: 9aa6e57 h: refs/heads/master v: v3
1 parent c89358b commit 1274b60

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 020d8f12a0993ddf0cd03862075b23d54a578142
2+
refs/heads/master: 9aa6e5750ef31d5ccc2c7edd184aaa3f7372ea00

trunk/src/lib/ptr.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ fn offset<T>(ptr: *T, count: uint) -> *T {
3434
ret rusti::ptr_offset(ptr, count);
3535
}
3636

37+
/*
38+
Function: mut_offset
39+
40+
Calculate the offset from a mutable pointer
41+
*/
42+
fn mut_offset<T>(ptr: *mutable T, count: uint) -> *mutable T {
43+
ret rusti::ptr_offset(ptr as *T, count) as *mutable T;
44+
}
45+
46+
3747
/*
3848
Function: null
3949

0 commit comments

Comments
 (0)