-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
The point of BufferedInStream is to call read()
on the underlying stream in bursts, rather than separate calls. E.g. to make 1 syscall to read()
reading 999 bytes, rather than 999 syscalls to read()
reading 1 byte each.
The point of PeekStream is to be able to "put back" bytes, so that the next call to read()
will get them again. In order to accomplish this, PeekStream needs a buffer. That makes PeekStream also a BufferedInStream.
All we need to unify these two APIs is for BufferedInStream to have a parameter called reserved_buffer_space
or something like this, and then it's guaranteed to be able to "put back" this many elements.
Related:
mlarouche, jayschwa, simonwuelker, Demonstrandum, JerwuQu and 8 more
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.