1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

Kernel: Share code between DoubleBuffer's read() and peek()

The only difference between these is whether the buffer index is
advanced after the read.
This commit is contained in:
Andreas Kling 2021-11-21 10:50:59 +01:00
parent 9387271049
commit b820ae2828
2 changed files with 13 additions and 17 deletions

View file

@ -54,6 +54,8 @@ private:
void flip();
void compute_lockfree_metadata();
ErrorOr<size_t> read_impl(UserOrKernelBuffer&, size_t, MutexLocker&, bool advance_buffer_index);
struct InnerBuffer {
u8* data { nullptr };
size_t size;