• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vbpf / prevail / 26372764981

24 May 2026 09:06PM UTC coverage: 86.456% (-0.2%) from 86.665%
26372764981

push

github

elazarg
Use COW shared_ptr for per-domain cell registry

The per-domain cell registry (introduced in the previous commit)
caused a 15-20% regression on heavy programs: every EbpfDomain copy
deep-cloned the registry, and every lattice join merged cell maps
that were already identical.

Introduce a generic Cow<T> wrapper (src/crab/cow.hpp) that enforces
copy-on-write through the type system: operator*/-> give const access;
get_mutable() detaches when shared. This eliminates the class of bugs
where a detach_cells() call is accidentally omitted — mutable access
is only possible through get_mutable(), which handles the COW dance.

Also return get_pre/get_post by const ref to avoid unnecessary copies
in join_all_prevs, and drop the now-unused array_domain.hpp include
from analysis_context.hpp.

Measured on cilium-core/bpf_host.o cil_host_policy:
  before: 0.50s  →  after: 0.42s (matches pre-refactor baseline).

Signed-off-by: Elazar Gershuni <elazarg@gmail.com>

40 of 45 new or added lines in 4 files covered. (88.89%)

120 existing lines in 5 files now uncovered.

8924 of 10322 relevant lines covered (86.46%)

6544581.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.98
/src/crab/type_to_num.cpp


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc