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

Method get_finalized_data

cranelift/jit/src/backend.rs:280–291  ·  view source on GitHub ↗

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

(&self, data_id: DataId)

Source from the content-addressed store, hash-verified

278 /// The pointer remains valid until either [`JITModule::free_memory`] is called or in the future
279 /// some way of deallocating this individual data object is used.
280 pub fn get_finalized_data(&self, data_id: DataId) -> (*const u8, usize) {
281 let info = &self.compiled_data_objects[data_id];
282 assert!(
283 !self.data_objects_to_finalize.iter().any(|x| *x == data_id),
284 "data object not yet finalized"
285 );
286 let compiled = info
287 .as_ref()
288 .expect("data object must be compiled before it can be finalized");
289
290 (compiled.ptr(), compiled.size())
291 }
292
293 fn record_function_for_perf(&self, ptr: *const u8, size: usize, name: &str) {
294 // The Linux perf tool supports JIT code via a /tmp/perf-$PID.map file,

Callers

nothing calls this directly

Calls 4

expectMethod · 0.45
as_refMethod · 0.45
ptrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected