# io_uring: incremental provided buffer consumption · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c133171567fe3a81f817d0ea159bd9229d75291c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c133171567fe3a81f817d0ea159bd9229d75291c

Requested commit: c133171567fe3a81f817d0ea159bd9229d75291c

Commit: c133171567fe3a81f817d0ea159bd9229d75291c

Tree: d6565515345ccf2fe738744af06bf5cbf5cc6a91

Author: Igor Anić

Committer: Igor Anić

## Message

```
io_uring: incremental provided buffer consumption

[Incremental provided buffer
consumption](https://github.com/axboe/liburing/wiki/What's-new-with-io_uring-in-6.11-and-6.12#incremental-provided-buffer-consumption)
support is added in kernel 6.12.

IoUring.BufferGroup will now use incremental consumption whenever
kernel supports it.

Before, provided buffers are wholly consumed when picked. Each cqe
points to the different buffer. With this, cqe points to the part of the
buffer. Multiple cqe's can reuse same buffer.
Appropriate sizing of buffers becomes less important.

There are slight changes in BufferGroup interface (it now needs to track
current receive point for each buffer). Init requires allocator
instead of buffers slice, it will allocate buffers slice and head
pointers slice. Get and put now requires cqe becasue there we have
information will the buffer be reused.

```

## Parents

- [4df039d235d5f77830fdc30a4c23121f6216364a](https://git.cafe/gitcafe/zig/commit/4df039d235d5f77830fdc30a4c23121f6216364a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c133171567fe3a81f817d0ea159bd9229d75291c?format=markdown)
