@@ -40,12 +40,13 @@ with destructors.
4040use cast;
4141use container:: { Map , Set } ;
4242use io;
43- use libc:: { size_t , uintptr_t} ;
43+ use libc:: { uintptr_t} ;
4444use option:: { None , Option , Some } ;
4545use ptr;
4646use hashmap:: HashSet ;
4747use stackwalk:: walk_stack;
4848use sys;
49+ use unstable:: intrinsics:: { TyDesc } ;
4950
5051pub use stackwalk:: Word ;
5152
@@ -58,17 +59,11 @@ pub struct StackSegment {
5859}
5960
6061pub mod rustrt {
61- use libc:: size_t;
6262 use stackwalk:: Word ;
6363 use super :: StackSegment ;
6464
6565 #[ link_name = "rustrt" ]
6666 pub extern {
67- #[ rust_stack]
68- pub unsafe fn rust_call_tydesc_glue ( root : * Word ,
69- tydesc : * Word ,
70- field : size_t ) ;
71-
7267 #[ rust_stack]
7368 pub unsafe fn rust_gc_metadata ( ) -> * Word ;
7469
@@ -125,7 +120,7 @@ unsafe fn is_safe_point(pc: *Word) -> Option<SafePoint> {
125120 return None ;
126121}
127122
128- type Visitor < ' self > = & ' self fn ( root : * * Word , tydesc : * Word ) -> bool ;
123+ type Visitor < ' self > = & ' self fn ( root : * * Word , tydesc : * TyDesc ) -> bool ;
129124
130125// Walks the list of roots for the given safe point, and calls visitor
131126// on each root.
@@ -139,7 +134,7 @@ unsafe fn _walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) -> bool {
139134 let stack_roots: * u32 = bump ( sp_meta, 2 ) ;
140135 let reg_roots: * u8 = bump ( stack_roots, num_stack_roots) ;
141136 let addrspaces: * Word = align_to_pointer ( bump ( reg_roots, num_reg_roots) ) ;
142- let tydescs: * * * Word = bump ( addrspaces, num_stack_roots) ;
137+ let tydescs: * * * TyDesc = bump ( addrspaces, num_stack_roots) ;
143138
144139 // Stack roots
145140 let mut sri = 0 ;
@@ -364,7 +359,7 @@ pub fn cleanup_stack_for_failure() {
364359 // FIXME #4420: Destroy this box
365360 // FIXME #4330: Destroy this box
366361 } else {
367- rustrt :: rust_call_tydesc_glue ( * root , tydesc, 3 as size_t ) ;
362+ ( ( * tydesc) . drop_glue ) ( & tydesc as * * TyDesc , * root as * i8 ) ;
368363 }
369364 }
370365 }
0 commit comments