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

Method finish

crates/cranelift/src/obj.rs:221–234  ·  view source on GitHub ↗

Indicates that the text section has been written completely and this will finish appending it to the original object. Note that this will also write out the unwind information sections if necessary.

(mut self, postprocess_text: impl FnOnce(&mut [u8]))

Source from the content-addressed store, hash-verified

219 /// Note that this will also write out the unwind information sections if
220 /// necessary.
221 pub fn finish(mut self, postprocess_text: impl FnOnce(&mut [u8])) {
222 // Finish up the text section now that we're done adding functions.
223 let mut text = self.text.finish(&mut self.ctrl_plane);
224
225 postprocess_text(&mut text[..]);
226
227 self.obj
228 .section_mut(self.text_section)
229 .set_data(text, text_align(self.compiler));
230
231 // Append the unwind information for all our functions, if necessary.
232 self.unwind_info
233 .append_section(self.compiler, self.obj, self.text_section);
234 }
235}
236
237/// Builder used to create unwind information for a set of functions added to a

Callers 6

buildMethod · 0.45
fmtMethod · 0.45
mockMethod · 0.45
parse_function_bodyFunction · 0.45

Calls 3

text_alignFunction · 0.85
append_sectionMethod · 0.80
set_dataMethod · 0.45

Tested by 1