@@ -243,39 +243,37 @@ fn entangle_buffer<T: send, Tstart: send>(
243
243
#[ abi = "rust-intrinsic" ]
244
244
#[ doc( hidden) ]
245
245
extern mod rusti {
246
- fn atomic_xchng ( & dst: int , src : int ) -> int ;
247
- fn atomic_xchng_acq ( & dst: int , src : int ) -> int ;
248
- fn atomic_xchng_rel ( & dst: int , src : int ) -> int ;
246
+ fn atomic_xchg ( dst : & mut int , src : int ) -> int ;
247
+ fn atomic_xchg_acq ( dst : & mut int , src : int ) -> int ;
248
+ fn atomic_xchg_rel ( dst : & mut int , src : int ) -> int ;
249
249
250
- fn atomic_add_acq ( & dst: int , src : int ) -> int ;
251
- fn atomic_sub_rel ( & dst: int , src : int ) -> int ;
250
+ fn atomic_xadd_acq ( dst : & mut int , src : int ) -> int ;
251
+ fn atomic_xsub_rel ( dst : & mut int , src : int ) -> int ;
252
252
}
253
253
254
254
// If I call the rusti versions directly from a polymorphic function,
255
255
// I get link errors. This is a bug that needs investigated more.
256
256
#[ doc( hidden) ]
257
257
fn atomic_xchng_rel ( dst : & mut int , src : int ) -> int {
258
- rusti:: atomic_xchng_rel ( * dst, src)
258
+ rusti:: atomic_xchg_rel ( dst, src)
259
259
}
260
260
261
261
#[ doc( hidden) ]
262
262
fn atomic_add_acq ( dst : & mut int , src : int ) -> int {
263
- rusti:: atomic_add_acq ( * dst, src)
263
+ rusti:: atomic_xadd_acq ( dst, src)
264
264
}
265
265
266
266
#[ doc( hidden) ]
267
267
fn atomic_sub_rel ( dst : & mut int , src : int ) -> int {
268
- rusti:: atomic_sub_rel ( * dst, src)
268
+ rusti:: atomic_xsub_rel ( dst, src)
269
269
}
270
270
271
271
#[ doc( hidden) ]
272
- fn swap_task ( dst : & mut * rust_task , src : * rust_task ) -> * rust_task {
272
+ fn swap_task ( + dst : & mut * rust_task , src : * rust_task ) -> * rust_task {
273
273
// It might be worth making both acquire and release versions of
274
274
// this.
275
275
unsafe {
276
- reinterpret_cast ( rusti:: atomic_xchng (
277
- * ( ptr:: mut_addr_of ( * dst) as * mut int ) ,
278
- src as int ) )
276
+ transmute ( rusti:: atomic_xchg ( transmute ( dst) , src as int ) )
279
277
}
280
278
}
281
279
@@ -309,20 +307,16 @@ fn wait_event(this: *rust_task) -> *libc::c_void {
309
307
}
310
308
311
309
#[ doc( hidden) ]
312
- fn swap_state_acq ( dst : & mut state , src : state ) -> state {
310
+ fn swap_state_acq ( + dst : & mut state , src : state ) -> state {
313
311
unsafe {
314
- reinterpret_cast ( rusti:: atomic_xchng_acq (
315
- * ( ptr:: mut_addr_of ( * dst) as * mut int ) ,
316
- src as int ) )
312
+ transmute ( rusti:: atomic_xchg_acq ( transmute ( dst) , src as int ) )
317
313
}
318
314
}
319
315
320
316
#[ doc( hidden) ]
321
- fn swap_state_rel ( dst : & mut state , src : state ) -> state {
317
+ fn swap_state_rel ( + dst : & mut state , src : state ) -> state {
322
318
unsafe {
323
- reinterpret_cast ( rusti:: atomic_xchng_rel (
324
- * ( ptr:: mut_addr_of ( * dst) as * mut int ) ,
325
- src as int ) )
319
+ transmute ( rusti:: atomic_xchg_rel ( transmute ( dst) , src as int ) )
326
320
}
327
321
}
328
322
0 commit comments