Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how #5

Open
seatrix opened this issue Aug 15, 2017 · 1 comment
Open

how #5

seatrix opened this issue Aug 15, 2017 · 1 comment
Assignees

Comments

@seatrix
Copy link

seatrix commented Aug 15, 2017

if I have a buff like below:

**12
^
|
A
Region B is not used.
Now, if I want to offer more than 2 bytes for example 4 bytes "3456", the bipbuf_offer will return 0.
But there are enough buffer for 4bytes, it can offer region B and the result will like below:

345612**
^ ^
| |
B A

@FlorianFranzen
Copy link

FlorianFranzen commented Aug 20, 2018

Region B is not a second equal sized buffer, that is allocated when the first buffer is full, but just a second consecutive region at the beginning of the ring buffer, that comes into use when the buffer is about to "roll over".
Region B allows the ring buffer to skip the last few bytes at the end of the buffer. This guarantees that all returned memory blocks by the ring buffer are consecutive.

@willemt willemt self-assigned this Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants