- fn __deregister_frame(fde: *const u8);
-}
-
-impl Drop for UnwindRegistry {
- fn drop(&mut self) {
- unsafe {
- // libgcc stores the frame entries as a linked list in decreasing sort order
- // based on the PC value of the registered entry.
- //
- // As we store the registrations in increasing order, it would be O(N^2) to
- // deregister in that order.
- //
- // To ensure that we just pop off the first element in the list upon every
- // deregistration, walk our list of registrations backwards.
- for fde in self.registrations.iter().rev() {
- __deregister_frame(*fde as *const _);
- }
- }
- }