Skip to content

Commit ad4557c

Browse files
committed
auto merge of #18367 : pcwalton/rust/inline-atomic-constructors, r=thestinger
Servo really wants this. r? @brson
2 parents c40fc79 + aa242e7 commit ad4557c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/atomic.rs

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ const UINT_TRUE: uint = -1;
9494
#[stable]
9595
impl AtomicBool {
9696
/// Create a new `AtomicBool`
97+
#[inline]
9798
pub fn new(v: bool) -> AtomicBool {
9899
let val = if v { UINT_TRUE } else { 0 };
99100
AtomicBool { v: UnsafeCell::new(val), nocopy: marker::NoCopy }
@@ -305,6 +306,7 @@ impl AtomicBool {
305306
#[stable]
306307
impl AtomicInt {
307308
/// Create a new `AtomicInt`
309+
#[inline]
308310
pub fn new(v: int) -> AtomicInt {
309311
AtomicInt {v: UnsafeCell::new(v), nocopy: marker::NoCopy}
310312
}
@@ -426,6 +428,7 @@ impl AtomicInt {
426428
#[stable]
427429
impl AtomicUint {
428430
/// Create a new `AtomicUint`
431+
#[inline]
429432
pub fn new(v: uint) -> AtomicUint {
430433
AtomicUint { v: UnsafeCell::new(v), nocopy: marker::NoCopy }
431434
}
@@ -547,6 +550,7 @@ impl AtomicUint {
547550
#[stable]
548551
impl<T> AtomicPtr<T> {
549552
/// Create a new `AtomicPtr`
553+
#[inline]
550554
pub fn new(p: *mut T) -> AtomicPtr<T> {
551555
AtomicPtr { p: UnsafeCell::new(p as uint), nocopy: marker::NoCopy }
552556
}

0 commit comments

Comments
 (0)