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

Method add

cranelift/interpreter/src/environment.rs:29–33  ·  view source on GitHub ↗

Add a function by name.

(&mut self, name: String, function: &'a Function)

Source from the content-addressed store, hash-verified

27impl<'a> FunctionStore<'a> {
28 /// Add a function by name.
29 pub fn add(&mut self, name: String, function: &'a Function) {
30 assert!(!self.function_names.contains_key(&name));
31 let index = self.functions.push(function);
32 self.function_names.insert(name, index);
33 }
34
35 /// Retrieve the index of a function in the function store by its `name`.
36 pub fn index_of(&self, name: &str) -> Option<FuncIndex> {

Callers 15

fromMethod · 0.45
additionFunction · 0.45
resolve_global_valueMethod · 0.45
sanityFunction · 0.45
udiv_by_zero_trapsFunction · 0.45
function_referencesFunction · 0.45
fuelFunction · 0.45
out_of_slot_write_trapsFunction · 0.45
out_of_slot_read_trapsFunction · 0.45

Calls 2

pushMethod · 0.45
insertMethod · 0.45

Tested by 15

additionFunction · 0.36
sanityFunction · 0.36
udiv_by_zero_trapsFunction · 0.36
function_referencesFunction · 0.36
fuelFunction · 0.36
out_of_slot_write_trapsFunction · 0.36
out_of_slot_read_trapsFunction · 0.36