-
Notifications
You must be signed in to change notification settings - Fork 291
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
ToxAV's rb_write
function is written in a strange way
#963
Comments
i think this should look like this (to make it clear):
|
Seems to happen a few lines above Line 54 in 1a54be0
But I agree with you, the variant you provide is more readable(!). Just the comment I have to say this is an interesting ringbuffer implementation, I would not have expected the inserted element in the buffer and the "first" element returned when the buffer is full. Needs some docs. |
it allocates (size + 1) in new. so there seems to be always an empty element there. or something? |
Seems so, also strange IMO, because normally you don't need an empty element. AFAICT when the buffer is full once, there's also no empty element anymore. |
rb_write
function is written in a strange way
It's still strange, but we've added a test for the behaviour, so this ticket is done. |
c-toxcore/toxav/ring_buffer.c
Lines 60 to 61 in 1a54be0
there is something i don't understand.
if this is ever reached should not also rc be set to start element. since now the start element is also pushed out?
me loves me some code without documentation ...
The text was updated successfully, but these errors were encountered: