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

Method new

crates/cranelift/src/debug/transform/address_transform.rs:246–270  ·  view source on GitHub ↗
(func: &'a FuncTransform, addr: WasmAddress)

Source from the content-addressed store, hash-verified

244
245impl<'a> TransformRangeStartIter<'a> {
246 fn new(func: &'a FuncTransform, addr: WasmAddress) -> Self {
247 let found = match func
248 .lookup
249 .index
250 .binary_search_by(|entry| entry.0.cmp(&addr))
251 {
252 Ok(i) => Some(&func.lookup.index[i].1),
253 Err(i) => {
254 if i > 0 {
255 Some(&func.lookup.index[i - 1].1)
256 } else {
257 None
258 }
259 }
260 };
261 if let Some(range_indices) = found {
262 TransformRangeStartIter {
263 addr,
264 indices: range_indices,
265 ranges: &func.lookup.ranges,
266 }
267 } else {
268 unreachable!();
269 }
270 }
271}
272
273impl<'a> Iterator for TransformRangeStartIter<'a> {

Callers

nothing calls this directly

Calls 10

build_function_lookupFunction · 0.85
build_function_addr_mapFunction · 0.85
from_iterFunction · 0.85
binary_search_byMethod · 0.80
defined_func_indicesMethod · 0.80
newFunction · 0.50
cmpMethod · 0.45
nextMethod · 0.45
functionMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected