MCPcopy Create free account
hub / github.com/GJDuck/e9patch / bb_lookup

Function bb_lookup

examples/cov.c:86–100  ·  view source on GitHub ↗

* BB lookup. */

Source from the content-addressed store, hash-verified

84 * BB lookup.
85 */
86static uintptr_t bb_lookup(uintptr_t target)
87{
88 ssize_t lo = 0, hi = BBs.size-1;
89 while (lo <= hi)
90 {
91 ssize_t mid = (lo + hi) / 2;
92 if (BBs.data[mid] < target)
93 lo = mid+1;
94 else if (BBs.data[mid] > target)
95 hi = mid-1;
96 else
97 return BBs.data[mid];
98 }
99 return BBs.data[lo];
100}
101
102/*
103 * ENTRY compare.

Callers 1

entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected