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

Feature sink source #157

Merged
merged 4 commits into from
Jan 17, 2024
Merged

Feature sink source #157

merged 4 commits into from
Jan 17, 2024

Conversation

cburstedde
Copy link
Owner

Improvements to the sc_io source/sink functionality

There are quite a few comment and documentation updates and two functional ones:

  1. We remember the end-of-file status on reading from a buffer or file and exit early next time around.
  2. When we read from an array buffer, we read at most its current elements and not, as previously, to the end of its internal memory allocation, which may be larger and contain undefined data.

In particular the latter update may have implications to existing code!

We remember if we reach the end of input.
In this case, any further reading returns 0 bytes.

We add a couple documentation items and assertions.
Previously we would read all allocated memory of an input buffer, even if
the elements require less than this byte size.  Changed to read at most the
elements present and no longer access undefined memory.
Copy link
Collaborator

@tim-griesbach tim-griesbach left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@cburstedde cburstedde merged commit 3675587 into develop Jan 17, 2024
34 checks passed
@cburstedde cburstedde deleted the feature-sink-source branch January 17, 2024 13:56
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