Gets the emit size of the unwind information, in bytes.
(&self)
| 180 | impl UnwindInfo { |
| 181 | /// Gets the emit size of the unwind information, in bytes. |
| 182 | pub fn emit_size(&self) -> usize { |
| 183 | let node_count = self.node_count(); |
| 184 | |
| 185 | // Calculation of the size requires no SEH handler or chained info |
| 186 | assert!(self.flags == 0); |
| 187 | |
| 188 | // Size of fixed part of UNWIND_INFO is 4 bytes |
| 189 | // Then comes the UNWIND_CODE nodes (2 bytes each) |
| 190 | // Then comes 2 bytes of padding for the unwind codes if necessary |
| 191 | // Next would come the SEH data, but we assert above that the function doesn't have SEH data |
| 192 | |
| 193 | 4 + (node_count * 2) + if (node_count & 1) == 1 { 2 } else { 0 } |
| 194 | } |
| 195 | |
| 196 | /// Emits the unwind information into the given mutable byte slice. |
| 197 | /// |