1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

AK: Report copied bytes when seekback copying from CircularBuffer

Otherwise, we have no way of determining whether our copy was truncated
by accident.
This commit is contained in:
Tim Schumacher 2023-04-04 18:29:43 +02:00 committed by Tim Flynn
parent 997e745e87
commit 767fb01a8c
2 changed files with 6 additions and 5 deletions

View file

@ -33,7 +33,7 @@ public:
/// before the current write pointer and allows for reading already-read data.
ErrorOr<Bytes> read_with_seekback(Bytes bytes, size_t distance);
ErrorOr<void> copy_from_seekback(size_t distance, size_t length);
ErrorOr<size_t> copy_from_seekback(size_t distance, size_t length);
[[nodiscard]] size_t empty_space() const;
[[nodiscard]] size_t used_space() const;