1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 02:17:34 +00:00

AK: Remove arbitrary 1 KB limit when filling a BufferedStream's buffer

When reading, we currently only fill a BufferedStream's buffer when it
is empty, and only with 1 KB of data. This means that while the buffer
defaults to a size of 16 KB, at least 15 KB is always unused.
This commit is contained in:
Timothy Flynn 2023-03-29 20:25:34 -04:00 committed by Andreas Kling
parent 8ff36e5910
commit 5c38b14045
3 changed files with 26 additions and 9 deletions

View file

@ -27,6 +27,7 @@ public:
size_t write(ReadonlyBytes bytes);
Bytes read(Bytes bytes);
ErrorOr<void> discard(size_t discarded_bytes);
ErrorOr<size_t> fill_from_stream(Stream&);
/// Compared to `read()`, this starts reading from an offset that is `distance` bytes
/// before the current write pointer and allows for reading already-read data.