bipbuffer icon indicating copy to clipboard operation
bipbuffer copied to clipboard

how

Open seatrix opened this issue 8 years ago • 1 comments

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

seatrix avatar Aug 15 '17 14:08 seatrix

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.

FlorianFranzen avatar Aug 20 '18 16:08 FlorianFranzen