Skip to content

Commit c735afe

Browse files
committed
---
yaml --- r: 16017 b: refs/heads/try c: 6ca6a3b h: refs/heads/master i: 16015: b4e18c3 v: v3
1 parent 800a081 commit c735afe

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 4fec4cd8f5ad45e8caea324df7434a82e560ca38
5+
refs/heads/try: 6ca6a3b80be1c7a5638156638a8a11e514bc3ef3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libstd/arc.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export arc, get, clone;
66
#[abi = "cdecl"]
77
native mod rustrt {
88
#[rust_stack]
9-
fn rust_atomic_increment(p: *mut libc::intptr_t)
9+
fn rust_atomic_increment(p: &mut libc::intptr_t)
1010
-> libc::intptr_t;
1111

1212
#[rust_stack]
13-
fn rust_atomic_decrement(p: *mut libc::intptr_t)
13+
fn rust_atomic_decrement(p: &mut libc::intptr_t)
1414
-> libc::intptr_t;
1515
}
1616

@@ -21,7 +21,7 @@ type arc_data<T> = {
2121

2222
resource arc_destruct<T>(data: *arc_data<T>) {
2323
unsafe {
24-
let ptr = ptr::mut_addr_of((*data).count);
24+
let ptr = &mut (*data).count;
2525

2626
let new_count = rustrt::rust_atomic_decrement(ptr);
2727
assert new_count >= 0;
@@ -52,8 +52,7 @@ fn get<T>(rc: &a.arc<T>) -> &a.T {
5252
fn clone<T>(rc: &arc<T>) -> arc<T> {
5353
let data = **rc;
5454
unsafe {
55-
rustrt::rust_atomic_increment(
56-
ptr::mut_addr_of((*data).count));
55+
rustrt::rust_atomic_increment(&mut (*data).count);
5756
}
5857
arc_destruct(**rc)
5958
}

0 commit comments

Comments
 (0)