MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / emit_size

Method emit_size

cranelift/codegen/src/isa/unwind/winx64.rs:182–194  ·  view source on GitHub ↗

Gets the emit size of the unwind information, in bytes.

(&self)

Source from the content-addressed store, hash-verified

180impl 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 ///

Callers 1

pushMethod · 0.80

Calls 1

node_countMethod · 0.80

Tested by

no test coverage detected