Skip to content
Permalink
Browse files

libcore: Inline atomic constructors.

Servo really wants this.
  • Loading branch information
pcwalton committed Oct 27, 2014
1 parent e2cd459 commit aa242e721a72292638872294d1b8f54caf91e3c8
Showing with 4 additions and 0 deletions.
  1. +4 −0 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 }
}

13 comments on commit aa242e7

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 29, 2014

saw approval from thestinger
at pcwalton@aa242e7

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 29, 2014

merging pcwalton/rust/inline-atomic-constructors = aa242e7 into auto

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 29, 2014

pcwalton/rust/inline-atomic-constructors = aa242e7 merged ok, testing candidate = 3757672

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

saw approval from thestinger
at pcwalton@aa242e7

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

merging pcwalton/rust/inline-atomic-constructors = aa242e7 into auto

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

pcwalton/rust/inline-atomic-constructors = aa242e7 merged ok, testing candidate = 0d1fa9c

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

saw approval from thestinger
at pcwalton@aa242e7

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

merging pcwalton/rust/inline-atomic-constructors = aa242e7 into auto

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

pcwalton/rust/inline-atomic-constructors = aa242e7 merged ok, testing candidate = ad4557c

@bors

This comment has been minimized.

Copy link
Contributor

@bors bors replied Oct 30, 2014

fast-forwarding master to auto = ad4557c

Please sign in to comment.
You can’t perform that action at this time.