Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircularBuffer: do not reset empty PublishableOutputRange #406

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

daniestevez
Copy link
Contributor

When an empty PublishableOutputRange is requested, do not reset the index, offet and internal span of the buffer.

This solution was suggested by @drslebedev to fix bugs in which the buffer state would become corrupted and report negative values (casted to uint64_t) for the available number of elements, etc.


I have tested this change on the gr4-packet-modem codebase and everything seems to work correctly with the single-threaded scheduler. Things that mysteriously failed before now work. All the QA tests in gr4-packet-modem and gnuradio4 pass. There are still some things in gr4-packet-modem that don't work with the multi-threaded scheduler, but probably the problem is unrelated.

When an empty PublishableOutputRange is requested, do not reset
the index, offet and internal span of the buffer.

This solution was suggested by @drslebedev to fix bugs in which
the buffer state would become corrupted and report negative values
(casted to uint64_t) for the available number of elements, etc.

Signed-off-by: Daniel Estévez <[email protected]>
Copy link
Contributor

@drslebedev drslebedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

The changes look good to me.
The PR can be merged once all tests have passed.

@wirew0rm
Copy link
Member

@all-contributors please add @daniestevez for code

Copy link
Contributor

@wirew0rm

I've put up a pull request to add @daniestevez! 🎉

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.

3 participants