Skip to content

Commit 525520d

Browse files
committed
---
yaml --- r: 110294 b: refs/heads/try c: 9f990f7 h: refs/heads/master v: v3
1 parent 94c40fe commit 525520d

File tree

4 files changed

+7
-41
lines changed

4 files changed

+7
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
5-
refs/heads/try: 2674a16c18df1841b3cc143e551e7eac6ded7423
5+
refs/heads/try: 9f990f74b3020b2639944add7012e01f22cb135b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ then
610610
LLVM_VERSION=$($LLVM_CONFIG --version)
611611

612612
case $LLVM_VERSION in
613-
(3.[2-5]svn|3.[2-5])
613+
(3.[2-5]*)
614614
msg "found ok version of LLVM: $LLVM_VERSION"
615615
;;
616616
(*)

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ syn match rustStringContinuation display contained /\\\n\s*/
135135
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation,@Spell
136136
syn region rustString start='r\z(#*\)"' end='"\z1' contains=@Spell
137137

138-
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDeriving
138+
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving
139139
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait
140140

141141
" Number literals

branches/try/src/libsync/arc.rs

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<T: Share + Send> Drop for Arc<T> {
165165
// Because `fetch_sub` is already atomic, we do not need to synchronize
166166
// with other threads unless we are going to delete the object. This
167167
// same logic applies to the below `fetch_sub` to the `weak` count.
168-
if self.inner().strong.fetch_sub(1, atomics::Release) != 1 { return }
168+
if self.inner().strong.fetch_sub(1, atomics::Release) != 0 { return }
169169

170170
// This fence is needed to prevent reordering of use of the data and
171171
// deletion of the data. Because it is marked `Release`, the
@@ -190,7 +190,7 @@ impl<T: Share + Send> Drop for Arc<T> {
190190
// allocation itself (there may still be weak pointers lying around).
191191
unsafe { drop(ptr::read(&self.inner().data)); }
192192

193-
if self.inner().weak.fetch_sub(1, atomics::Release) == 1 {
193+
if self.inner().weak.fetch_sub(1, atomics::Release) == 0 {
194194
atomics::fence(atomics::Acquire);
195195
unsafe { global_heap::exchange_free(self.x as *u8) }
196196
}
@@ -240,7 +240,7 @@ impl<T: Share + Send> Drop for Weak<T> {
240240
// If we find out that we were the last weak pointer, then its time to
241241
// deallocate the data entirely. See the discussion in Arc::drop() about
242242
// the memory orderings
243-
if self.inner().weak.fetch_sub(1, atomics::Release) == 1 {
243+
if self.inner().weak.fetch_sub(1, atomics::Release) == 0 {
244244
atomics::fence(atomics::Acquire);
245245
unsafe { global_heap::exchange_free(self.x as *u8) }
246246
}
@@ -251,24 +251,9 @@ impl<T: Share + Send> Drop for Weak<T> {
251251
#[allow(experimental)]
252252
mod tests {
253253
use super::{Arc, Weak};
254-
use std::sync::atomics;
255-
use std::task;
256254
use Mutex;
257255

258-
struct Canary(*mut atomics::AtomicUint);
259-
260-
impl Drop for Canary
261-
{
262-
fn drop(&mut self) {
263-
unsafe {
264-
match *self {
265-
Canary(c) => {
266-
(*c).fetch_add(1, atomics::SeqCst);
267-
}
268-
}
269-
}
270-
}
271-
}
256+
use std::task;
272257

273258
#[test]
274259
fn manually_share_arc() {
@@ -364,23 +349,4 @@ mod tests {
364349

365350
// hopefully we don't double-free (or leak)...
366351
}
367-
368-
#[test]
369-
fn drop_arc() {
370-
let mut canary = atomics::AtomicUint::new(0);
371-
let x = Arc::new(Canary(&mut canary as *mut atomics::AtomicUint));
372-
drop(x);
373-
assert!(canary.load(atomics::Acquire) == 1);
374-
}
375-
376-
#[test]
377-
fn drop_arc_weak() {
378-
let mut canary = atomics::AtomicUint::new(0);
379-
let arc = Arc::new(Canary(&mut canary as *mut atomics::AtomicUint));
380-
let arc_weak = arc.downgrade();
381-
assert!(canary.load(atomics::Acquire) == 0);
382-
drop(arc);
383-
assert!(canary.load(atomics::Acquire) == 1);
384-
drop(arc_weak);
385-
}
386352
}

0 commit comments

Comments
 (0)