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

Function find_funcs

tests/all/memory.rs:52–72  ·  view source on GitHub ↗
(store: &mut Store<()>, instance: &Instance)

Source from the content-addressed store, hash-verified

50}
51
52fn find_funcs(store: &mut Store<()>, instance: &Instance) -> Vec<TestFunc> {
53 let list = instance
54 .exports(&mut *store)
55 .map(|export| {
56 let name = export.name();
57 let mut parts = name.split_whitespace();
58 (
59 parts.next().unwrap().parse().unwrap(),
60 parts.next().unwrap().parse().unwrap(),
61 export.into_func().unwrap(),
62 )
63 })
64 .collect::<Vec<_>>();
65 list.into_iter()
66 .map(|(width, offset, func)| TestFunc {
67 width,
68 offset,
69 func: func.typed(&store).unwrap(),
70 })
71 .collect()
72}
73
74fn test_traps(store: &mut Store<()>, funcs: &[TestFunc], addr: u32, mem: &Memory) {
75 let mem_size = mem.data_size(&store) as u64;

Callers 1

Calls 10

collectMethod · 0.80
mapMethod · 0.45
exportsMethod · 0.45
nameMethod · 0.45
unwrapMethod · 0.45
parseMethod · 0.45
nextMethod · 0.45
into_funcMethod · 0.45
into_iterMethod · 0.45
typedMethod · 0.45

Tested by

no test coverage detected