⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@roderickvd
Copy link
Member

Continuing from discussion at #828.

Changes:

  • current_span_len consistently returns total samples in the current span
  • size_hint returns the remaining samples, if known
  • ExactSizeIterator is implemented where the inner source has a fixed length
  • try_seek takes into account mid-span seeks where necessary
  • some opportunistic bug fixes

I did not fix up the decoders, as I had already done so under the infamous #786.

This comment was marked as resolved.

This comment was marked as resolved.

@roderickvd roderickvd removed the request for review from yara-blue January 14, 2026 21:49
roderickvd and others added 17 commits January 15, 2026 00:02
* Use VecDeque for output buffering and avoid O(n) remove(0) operations.
* Replace Mutex+Atomic pending list with a channel and consume via try_recv.
* Drain/retain_mut sources in-place to reduce allocations and copies.
Replace the Vec used for next_sounds with VecDeque to avoid O(n)
shifts when removing from the front.
Clarify Source::current_span_len() returns total span length (not remaining),
while size_hint() returns remaining samples. Fix multiple bugs in span boundary
detection, seeking, and iterator implementations.

Opportunistic fixes:
- fix division by zero, off-by-one error, and zero case handling
- prevent counter overflows
- optimize vector allocations

Mid-span seeking: best-effort tracking after try_seek() to detect span boundaries
when seeking lands mid-span.

Fixes #691
@roderickvd roderickvd force-pushed the fix/span-consistency branch from 7be9aa4 to 39d60f4 Compare January 14, 2026 23:04
@roderickvd
Copy link
Member Author

GitHub commit log is broken after squashing: opened a new PR.

@roderickvd roderickvd closed this Jan 14, 2026
@roderickvd roderickvd deleted the fix/span-consistency branch January 14, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants