diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-10-27 09:14:57 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-10-27 09:14:57 -0700 |
| commit | aa242e721a72292638872294d1b8f54caf91e3c8 (patch) | |
| tree | 3bf5c8d5d82f63bc1ccc2bdf7c758bd332f4d0af /src | |
| parent | e2cd4597dae1ed0aa3967bd2a656a42daa1ad27f (diff) | |
| download | rust-aa242e721a72292638872294d1b8f54caf91e3c8.tar.gz rust-aa242e721a72292638872294d1b8f54caf91e3c8.zip | |
libcore: Inline atomic constructors.
Servo really wants this.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/atomic.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index cc6fe06665b..0b2b97794dc 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -94,6 +94,7 @@ const UINT_TRUE: uint = -1; #[stable] impl AtomicBool { /// Create a new `AtomicBool` + #[inline] pub fn new(v: bool) -> AtomicBool { let val = if v { UINT_TRUE } else { 0 }; AtomicBool { v: UnsafeCell::new(val), nocopy: marker::NoCopy } @@ -305,6 +306,7 @@ impl AtomicBool { #[stable] impl AtomicInt { /// Create a new `AtomicInt` + #[inline] pub fn new(v: int) -> AtomicInt { AtomicInt {v: UnsafeCell::new(v), nocopy: marker::NoCopy} } @@ -426,6 +428,7 @@ impl AtomicInt { #[stable] impl AtomicUint { /// Create a new `AtomicUint` + #[inline] pub fn new(v: uint) -> AtomicUint { AtomicUint { v: UnsafeCell::new(v), nocopy: marker::NoCopy } } @@ -547,6 +550,7 @@ impl AtomicUint { #[stable] impl<T> AtomicPtr<T> { /// Create a new `AtomicPtr` + #[inline] pub fn new(p: *mut T) -> AtomicPtr<T> { AtomicPtr { p: UnsafeCell::new(p as uint), nocopy: marker::NoCopy } } |
