summaryrefslogtreecommitdiff
path: root/AK/CircularBuffer.cpp
AgeCommit message (Collapse)Author
2023-03-21AK: Expose the seekback limit of CircularBufferTim Schumacher
2023-01-15AK+Test: Fix a logic error in `CircularBuffer::offset_of()`Lucas CHOLLET
This error was introduced by 9a7accdd and had a significant impact on `BufferedFile` behavior. Hence, we started seeing crash in test262. By itself, the issue was a wrong calculation of the internal reading spans when using the `read` and `until` parameters. Which can lead to at worse crash in VERIFY and at least weird behaviors as missed needles or detections out of bounds. It was also accompanied by an erroneous test. This patch fixes the bug, the test and also provides more tests.
2023-01-14AK: Add an optional starting offset to `CircularBuffer::offset_of`Lucas CHOLLET
This parameter allows to start searching after an offset. For example, to resume a search. It is unfortunately a breaking change in API so this patch also modifies one user and one test.
2023-01-13AK: Add `CircularBuffer::read_with_seekback`Tim Schumacher
2022-12-31AK: Add `CircularBuffer`Lucas CHOLLET
The class is very similar to `CircularDuplexStream` in its behavior. Main differences are that `CircularBuffer`: - does not inherit from `AK::Stream` - uses `ErrorOr` for its API - is heap allocated (and OOM-Safe) This patch also add some tests.