@@ -36,60 +36,54 @@ pub extern mod rustrt {
3636 unsafe fn rust_upcall_free ( ptr : * c_char ) ;
3737}
3838
39- #[ rt( fail_) ]
4039#[ lang="fail_" ]
41- pub fn rt_fail_ ( expr : * c_char , file : * c_char , line : size_t ) -> ! {
40+ pub fn fail_ ( expr : * c_char , file : * c_char , line : size_t ) -> ! {
4241 sys:: begin_unwind_ ( expr, file, line) ;
4342}
4443
45- #[ rt( fail_bounds_check) ]
4644#[ lang="fail_bounds_check" ]
47- pub unsafe fn rt_fail_bounds_check ( file : * c_char , line : size_t ,
48- index : size_t , len : size_t ) {
45+ pub unsafe fn fail_bounds_check ( file : * c_char , line : size_t ,
46+ index : size_t , len : size_t ) {
4947 let msg = fmt ! ( "index out of bounds: the len is %d but the index is %d" ,
5048 len as int, index as int) ;
5149 do str:: as_buf ( msg) |p, _len| {
52- rt_fail_ ( p as * c_char , file, line) ;
50+ fail_ ( p as * c_char , file, line) ;
5351 }
5452}
5553
56- pub unsafe fn rt_fail_borrowed ( ) {
54+ pub unsafe fn fail_borrowed ( ) {
5755 let msg = "borrowed" ;
5856 do str:: as_buf ( msg) |msg_p, _| {
5957 do str:: as_buf ( "???" ) |file_p, _| {
60- rt_fail_ ( msg_p as * c_char , file_p as * c_char , 0 ) ;
58+ fail_ ( msg_p as * c_char , file_p as * c_char , 0 ) ;
6159 }
6260 }
6361}
6462
6563// FIXME #4942: Make these signatures agree with exchange_alloc's signatures
66- #[ rt( exchange_malloc) ]
6764#[ lang="exchange_malloc" ]
68- pub unsafe fn rt_exchange_malloc ( td : * c_char , size : uintptr_t ) -> * c_char {
65+ pub unsafe fn exchange_malloc ( td : * c_char , size : uintptr_t ) -> * c_char {
6966 transmute ( exchange_alloc:: malloc ( transmute ( td) , transmute ( size) ) )
7067}
7168
7269// NB: Calls to free CANNOT be allowed to fail, as throwing an exception from
7370// inside a landing pad may corrupt the state of the exception handler. If a
7471// problem occurs, call exit instead.
75- #[ rt( exchange_free) ]
7672#[ lang="exchange_free" ]
77- pub unsafe fn rt_exchange_free ( ptr : * c_char ) {
73+ pub unsafe fn exchange_free ( ptr : * c_char ) {
7874 exchange_alloc:: free ( transmute ( ptr) )
7975}
8076
81- #[ rt( malloc) ]
8277#[ lang="malloc" ]
83- pub unsafe fn rt_malloc ( td : * c_char , size : uintptr_t ) -> * c_char {
78+ pub unsafe fn local_malloc ( td : * c_char , size : uintptr_t ) -> * c_char {
8479 return rustrt:: rust_upcall_malloc ( td, size) ;
8580}
8681
8782// NB: Calls to free CANNOT be allowed to fail, as throwing an exception from
8883// inside a landing pad may corrupt the state of the exception handler. If a
8984// problem occurs, call exit instead.
90- #[ rt( free) ]
9185#[ lang="free" ]
92- pub unsafe fn rt_free ( ptr : * c_char ) {
86+ pub unsafe fn local_free ( ptr : * c_char ) {
9387 rustrt:: rust_upcall_free ( ptr) ;
9488}
9589
@@ -112,7 +106,7 @@ pub unsafe fn return_to_mut(a: *u8) {
112106pub unsafe fn check_not_borrowed ( a : * u8 ) {
113107 let a: * mut BoxRepr = transmute ( a) ;
114108 if ( ( * a) . header . ref_count & FROZEN_BIT ) != 0 {
115- rt_fail_borrowed ( ) ;
109+ fail_borrowed ( ) ;
116110 }
117111}
118112
0 commit comments