SAFETY: the gc_box must never be accessed after calling this function.
(mut gc_box: GcBox)
| 590 | |
| 591 | // SAFETY: the gc_box must never be accessed after calling this function. |
| 592 | unsafe fn free_gc_box(mut gc_box: GcBox) { |
| 593 | unsafe { |
| 594 | if gc_box.header().is_live() { |
| 595 | // If the alive flag is set, that means we haven't dropped the inner value of this object, |
| 596 | gc_box.drop_in_place(); |
| 597 | } |
| 598 | gc_box.dealloc(); |
| 599 | } |
| 600 | } |
| 601 | |
| 602 | /// Helper type for managing phase transitions. |
| 603 | struct PhaseGuard<'a> { |
no test coverage detected