File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed
branches/dist-snap/src/libcore Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: 3c14dae4a64b791eec86a11f04fcbeab5df23911
10
+ refs/heads/dist-snap: 4ce2ee12beea76727fe2ced87748c31725ce4e98
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ pure fn shape_le<T:Ord>(x1: &T, x2: &T) -> bool {
65
65
* Useful for calling certain function in the Rust runtime or otherwise
66
66
* performing dark magick.
67
67
*/
68
+ #[ inline( always) ]
68
69
pure fn get_type_desc < T > ( ) -> * TypeDesc {
69
70
unchecked { rusti : : get_tydesc :: < T > ( ) as * TypeDesc }
70
71
}
@@ -93,6 +94,7 @@ pure fn pref_align_of<T>() -> uint {
93
94
}
94
95
95
96
/// Returns the refcount of a shared box (as just before calling this)
97
+ #[ inline( always) ]
96
98
pure fn refcount < T > ( +t : @T ) -> uint {
97
99
unsafe {
98
100
let ref_ptr: * uint = unsafe :: reinterpret_cast ( & t) ;
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ unsafe fn bump_box_refcount<T>(+t: @T) { forget(move t); }
51
51
*
52
52
* assert transmute("L") == ~[76u8, 0u8];
53
53
*/
54
+ #[ inline( always) ]
54
55
unsafe fn transmute < L , G > ( -thing : L ) -> G {
55
56
debug ! ( ">>> in transmute! <<<" ) ;
56
57
debug ! ( "transmute 1: %?" , & thing) ;
@@ -61,26 +62,33 @@ unsafe fn transmute<L, G>(-thing: L) -> G {
61
62
}
62
63
63
64
/// Coerce an immutable reference to be mutable.
65
+ #[ inline( always) ]
64
66
unsafe fn transmute_mut < T > ( +ptr : & a /T ) -> & a/mut T { transmute ( move ptr) }
65
67
66
68
/// Coerce a mutable reference to be immutable.
69
+ #[ inline( always) ]
67
70
unsafe fn transmute_immut < T > ( +ptr : & a/mut T ) -> & a /T { transmute ( move ptr) }
68
71
69
72
/// Coerce a borrowed pointer to have an arbitrary associated region.
73
+ #[ inline( always) ]
70
74
unsafe fn transmute_region < T > ( +ptr : & a /T ) -> & b /T { transmute ( move ptr) }
71
75
72
76
/// Coerce an immutable reference to be mutable.
77
+ #[ inline( always) ]
73
78
unsafe fn transmute_mut_unsafe < T > ( +ptr : * const T ) -> * mut T { transmute ( ptr) }
74
79
75
80
/// Coerce an immutable reference to be mutable.
81
+ #[ inline( always) ]
76
82
unsafe fn transmute_immut_unsafe < T > ( +ptr : * const T ) -> * T { transmute ( ptr) }
77
83
78
84
/// Coerce a borrowed mutable pointer to have an arbitrary associated region.
85
+ #[ inline( always) ]
79
86
unsafe fn transmute_mut_region < T > ( +ptr : & a/mut T ) -> & b/mut T {
80
87
transmute ( move ptr)
81
88
}
82
89
83
90
/// Transforms lifetime of the second pointer to match the first.
91
+ #[ inline( always) ]
84
92
unsafe fn copy_lifetime < S , T > ( _ptr : & a /S , ptr : & T ) -> & a /T {
85
93
transmute_region ( ptr)
86
94
}
Original file line number Diff line number Diff line change @@ -9,9 +9,11 @@ use cmp::Eq;
9
9
*/
10
10
11
11
/// The identity function.
12
+ #[ inline( always) ]
12
13
pure fn id < T > ( +x : T ) -> T { move x }
13
14
14
15
/// Ignores a value.
16
+ #[ inline( always) ]
15
17
pure fn ignore < T > ( +_x : T ) { }
16
18
17
19
/// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
You can’t perform that action at this time.
0 commit comments