diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-09-11 15:57:32 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-09-12 14:48:18 -0700 |
| commit | 4ce2ee12beea76727fe2ced87748c31725ce4e98 (patch) | |
| tree | a837e441e337093f546d659507f8252f44cb7be6 /src/libcore/sys.rs | |
| parent | 3c14dae4a64b791eec86a11f04fcbeab5df23911 (diff) | |
| download | rust-4ce2ee12beea76727fe2ced87748c31725ce4e98.tar.gz rust-4ce2ee12beea76727fe2ced87748c31725ce4e98.zip | |
Add a bunch of inline hints.
Diffstat (limited to 'src/libcore/sys.rs')
| -rw-r--r-- | src/libcore/sys.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index 8eee6088630..cff945ad069 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -65,6 +65,7 @@ pure fn shape_le<T:Ord>(x1: &T, x2: &T) -> bool { * Useful for calling certain function in the Rust runtime or otherwise * performing dark magick. */ +#[inline(always)] pure fn get_type_desc<T>() -> *TypeDesc { unchecked { rusti::get_tydesc::<T>() as *TypeDesc } } @@ -93,6 +94,7 @@ pure fn pref_align_of<T>() -> uint { } /// Returns the refcount of a shared box (as just before calling this) +#[inline(always)] pure fn refcount<T>(+t: @T) -> uint { unsafe { let ref_ptr: *uint = unsafe::reinterpret_cast(&t); |
