]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/atomic.rs
auto merge of #18367 : pcwalton/rust/inline-atomic-constructors, r=thestinger
[rust.git] / src / libcore / atomic.rs
index f272465e796260d268a39946575b295b9d5fd45e..c3172a66f6b26540311f7d51c8bc5205f4d4474f 100644 (file)
@@ -94,6 +94,7 @@ pub enum Ordering {
 #[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 @@ pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
 #[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 @@ pub fn fetch_xor(&self, val: int, order: Ordering) -> int {
 #[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 @@ pub fn fetch_xor(&self, val: uint, order: Ordering) -> uint {
 #[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 }
     }