Skip to content

Add zero-copy CBOR views#720

Merged
danielaparker merged 3 commits into
danielaparker:masterfrom
ky438:cbor-view
Jul 8, 2026
Merged

Add zero-copy CBOR views#720
danielaparker merged 3 commits into
danielaparker:masterfrom
ky438:cbor-view

Conversation

@ky438

@ky438 ky438 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
  • add source-level exact span reads and use them for definite-length CBOR text/byte strings
  • add raw CBOR view utilities for item spans, skipping, etc
  • add coverage for zero-copy cursor views, stream straddling, raw item spans, collation, and invalid view input

built with gpt5.5-xhigh

@ky438

ky438 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up:

  • add bulk append support for bytes_sink and use it for CBOR text/byte payload writes
  • expose cbor::view::map_entry_view and cbor::view::map_entries() for zero-copy map traversal
  • make cbor::view::compare() compare indefinite/chunked text and byte strings semantically
  • add tests for map entry spans and semantic chunked string comparison

@ky438

ky438 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up fix for the CIFuzz failure on fuzz_cbor:

  • bound stream_source::read_span() growth so malformed huge string lengths cannot trigger an unbounded allocation
  • fall back to the existing copy path when a safe span is unavailable
  • add a regression test for the fuzzed test case
  • avoid exact reserve before bytes_sink insert-based appends
  • share CBOR text/byte length header encoding through one helper

@danielaparker danielaparker merged commit 3eda09e into danielaparker:master Jul 8, 2026
35 checks passed
@danielaparker

Copy link
Copy Markdown
Owner

Thanks! This contribution is very much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants