@@ -27,14 +27,14 @@ impl Drop for GcState {
2727 {
2828 let mut p = & self . boxes_start ;
2929 while let Some ( node) = * p {
30- Finalize :: finalize ( & ( * * node) . data ) ;
31- p = & ( * * node) . header . next ;
30+ Finalize :: finalize ( & ( * node. as_ptr ( ) ) . data ) ;
31+ p = & ( * node. as_ptr ( ) ) . header . next ;
3232 }
3333 }
3434
3535 let _guard = DropGuard :: new ( ) ;
3636 while let Some ( node) = self . boxes_start {
37- let node = Box :: from_raw ( * node) ;
37+ let node = Box :: from_raw ( node. as_ptr ( ) ) ;
3838 self . boxes_start = node. header . next ;
3939 }
4040 }
@@ -162,39 +162,39 @@ fn collect_garbage(st: &mut GcState) {
162162 // Walk the tree, tracing and marking the nodes
163163 let mut mark_head = * head;
164164 while let Some ( node) = mark_head {
165- if ( * * node) . header . roots . get ( ) > 0 {
166- ( * * node) . trace_inner ( ) ;
165+ if ( * node. as_ptr ( ) ) . header . roots . get ( ) > 0 {
166+ ( * node. as_ptr ( ) ) . trace_inner ( ) ;
167167 }
168168
169- mark_head = ( * * node) . header . next ;
169+ mark_head = ( * node. as_ptr ( ) ) . header . next ;
170170 }
171171
172172 // Collect a vector of all of the nodes which were not marked,
173173 // and unmark the ones which were.
174174 let mut unmarked = Vec :: new ( ) ;
175175 let mut unmark_head = head;
176176 while let Some ( node) = * unmark_head {
177- if ( * * node) . header . marked . get ( ) {
178- ( * * node) . header . marked . set ( false ) ;
177+ if ( * node. as_ptr ( ) ) . header . marked . get ( ) {
178+ ( * node. as_ptr ( ) ) . header . marked . set ( false ) ;
179179 } else {
180180 unmarked. push ( Unmarked {
181181 incoming : unmark_head,
182182 this : node,
183183 } ) ;
184184 }
185- unmark_head = & mut ( * * node) . header . next ;
185+ unmark_head = & mut ( * node. as_ptr ( ) ) . header . next ;
186186 }
187187 unmarked
188188 }
189189
190190 unsafe fn sweep ( finalized : Vec < Unmarked > , bytes_allocated : & mut usize ) {
191191 let _guard = DropGuard :: new ( ) ;
192192 for node in finalized. into_iter ( ) . rev ( ) {
193- if ( * * node. this ) . header . marked . get ( ) {
193+ if ( * node. this . as_ptr ( ) ) . header . marked . get ( ) {
194194 continue ;
195195 }
196196 let incoming = node. incoming ;
197- let mut node = Box :: from_raw ( * node. this ) ;
197+ let mut node = Box :: from_raw ( node. this . as_ptr ( ) ) ;
198198 * bytes_allocated -= mem:: size_of_val :: < GcBox < _ > > ( & * node) ;
199199 * incoming = node. header . next . take ( ) ;
200200 }
@@ -206,7 +206,7 @@ fn collect_garbage(st: &mut GcState) {
206206 return ;
207207 }
208208 for node in & unmarked {
209- Trace :: finalize_glue ( & ( * * node. this ) . data ) ;
209+ Trace :: finalize_glue ( & ( * node. this . as_ptr ( ) ) . data ) ;
210210 }
211211 mark ( & mut st. boxes_start ) ;
212212 sweep ( unmarked, & mut st. bytes_allocated ) ;
0 commit comments