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

Method get_finalized_function

cranelift/jit/src/backend.rs:265–274  ·  view source on GitHub ↗

Returns the address of a finalized function. The pointer remains valid until either [`JITModule::free_memory`] is called or in the future some way of deallocating this individual function is used.

(&self, func_id: FuncId)

Source from the content-addressed store, hash-verified

263 /// The pointer remains valid until either [`JITModule::free_memory`] is called or in the future
264 /// some way of deallocating this individual function is used.
265 pub fn get_finalized_function(&self, func_id: FuncId) -> *const u8 {
266 let info = &self.compiled_functions[func_id];
267 assert!(
268 !self.functions_to_finalize.iter().any(|x| *x == func_id),
269 "function not yet finalized"
270 );
271 info.as_ref()
272 .expect("function must be compiled before it can be finalized")
273 .ptr()
274 }
275
276 /// Returns the address and size of a finalized data object.
277 ///

Callers 2

callMethod · 0.80
mainFunction · 0.80

Calls 3

ptrMethod · 0.45
expectMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected