@@ -391,58 +391,54 @@ pub unsafe fn record_sp_limit(limit: uint) {
391
391
/// As with the setter, this function does not have a __morestack header and can
392
392
/// therefore be called in a "we're out of stack" situation.
393
393
#[ inline( always) ]
394
- // NOTE: after the next snapshot, can remove the initialization before inline
395
- // assembly due to an improvement in how it's handled, then this specific
396
- // allow directive should get removed.
397
- #[ allow( dead_assignment) ]
398
394
pub unsafe fn get_sp_limit ( ) -> uint {
399
395
return target_get_sp_limit ( ) ;
400
396
401
397
// x86-64
402
398
#[ cfg( target_arch = "x86_64" , target_os = "macos" ) ] #[ inline( always) ]
403
399
unsafe fn target_get_sp_limit ( ) -> uint {
404
- let mut limit: uint = 0 ;
400
+ let limit;
405
401
asm ! ( "movq $$0x60+90*8, %rsi
406
402
movq %gs:(%rsi), $0" : "=r" ( limit) :: "rsi" : "volatile" ) ;
407
403
return limit;
408
404
}
409
405
#[ cfg( target_arch = "x86_64" , target_os = "linux" ) ] #[ inline( always) ]
410
406
unsafe fn target_get_sp_limit ( ) -> uint {
411
- let mut limit: uint = 0 ;
407
+ let limit;
412
408
asm ! ( "movq %fs:112, $0" : "=r" ( limit) :: : "volatile" ) ;
413
409
return limit;
414
410
}
415
411
#[ cfg( target_arch = "x86_64" , target_os = "win32" ) ] #[ inline( always) ]
416
412
unsafe fn target_get_sp_limit ( ) -> uint {
417
- let mut limit: uint = 0 ;
413
+ let limit;
418
414
asm ! ( "movq %gs:0x28, $0" : "=r" ( limit) :: : "volatile" ) ;
419
415
return limit;
420
416
}
421
417
#[ cfg( target_arch = "x86_64" , target_os = "freebsd" ) ] #[ inline( always) ]
422
418
unsafe fn target_get_sp_limit ( ) -> uint {
423
- let mut limit: uint = 0 ;
419
+ let limit;
424
420
asm ! ( "movq %fs:24, $0" : "=r" ( limit) :: : "volatile" ) ;
425
421
return limit;
426
422
}
427
423
428
424
// x86
429
425
#[ cfg( target_arch = "x86" , target_os = "macos" ) ] #[ inline( always) ]
430
426
unsafe fn target_get_sp_limit ( ) -> uint {
431
- let mut limit: uint = 0 ;
427
+ let limit;
432
428
asm ! ( "movl $$0x48+90*4, %eax
433
429
movl %gs:(%eax), $0" : "=r" ( limit) :: "eax" : "volatile" ) ;
434
430
return limit;
435
431
}
436
432
#[ cfg( target_arch = "x86" , target_os = "linux" ) ]
437
433
#[ cfg( target_arch = "x86" , target_os = "freebsd" ) ] #[ inline( always) ]
438
434
unsafe fn target_get_sp_limit ( ) -> uint {
439
- let mut limit: uint = 0 ;
435
+ let limit;
440
436
asm ! ( "movl %gs:48, $0" : "=r" ( limit) :: : "volatile" ) ;
441
437
return limit;
442
438
}
443
439
#[ cfg( target_arch = "x86" , target_os = "win32" ) ] #[ inline( always) ]
444
440
unsafe fn target_get_sp_limit ( ) -> uint {
445
- let mut limit: uint = 0 ;
441
+ let limit;
446
442
asm ! ( "movl %fs:0x14, $0" : "=r" ( limit) :: : "volatile" ) ;
447
443
return limit;
448
444
}
0 commit comments