Skip to main content

Module sample_bytes

Module sample_bytes 

Source
Expand description

SampleBytes — zero-copy byte container for reader-path samples.

Spec: docs/specs/zerodds-zero-copy-1.0.md §6 Wave 2.

§Background

UserSample::Alive::payload was historically a Vec<u8>. That forced strip_user_encap to cut off the encap-header offset via payload[off..].to_vec() — one heap alloc + copy per alive sample.

SampleBytes replaces that Vec with an Arc<[u8]> + range. Strip operations become pure index arithmetic (Arc::clone is a refcount bump, not a copy). Heap allocs are eliminated on the hot path.

§API

Structs§

SampleBytes
Refcounted byte container for reader-path samples.