-
Notifications
You must be signed in to change notification settings - Fork 280
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
Move ring buffer out of toxcore/util into toxav. #163
Conversation
2a77f16
to
d864c50
Compare
// XXX: Hack because toxav doesn't really expose ring_buffer, but this av test | ||
// uses it. | ||
#define RingBuffer TestRingBuffer | ||
#define rb_full test_rb_full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these aren't actually used in this test. They should be removed to make the code easier to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They aren't used, but if linking statically, not renaming them will cause multiple definition errors. We need to rename all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention the static linking issue in the comment too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the need for ring_buffer compilation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nurupo done.
@@ -0,0 +1,18 @@ | |||
#ifndef RING_BUFFER_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header needs a comment as to the point of RingBuffer (and maybe a rename!),
FYI ring buffer stores AV packets received so ToxAV can calculate the mean on how many packets are lost/received.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the point of RingBuffer. This PR just moves it out of toxcore where it doesn't belong. @mannol can add documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrayHatter It's literally a name of the data type. I don't see a point in renaming it for this special case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH... I've been reading it as ring, as in ringing call... too much AV on the brain
// XXX: Hack because toxav doesn't really expose ring_buffer, but this av test | ||
// uses it. | ||
#define RingBuffer TestRingBuffer | ||
#define rb_full test_rb_full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mention the static linking issue in the comment too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall good; just a few clarifications needed.
@@ -0,0 +1,18 @@ | |||
#ifndef RING_BUFFER_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrayHatter It's literally a name of the data type. I don't see a point in renaming it for this special case.
// XXX: Hack because toxav doesn't really expose ring_buffer, but this av test | ||
// uses it. | ||
#define RingBuffer TestRingBuffer | ||
#define rb_full test_rb_full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the need for ring_buffer compilation here?
25c2694
to
311fbce
Compare
Since I can't reply to the review thread (@mannol do you still like github reviews better than reviewable?):
|
I do. We should just avoid force pushing; at least until the review is complete. |
The symbols are not part of the ABI, and since #117, toxav does not export those symbols in the .so file anymore (on linux). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iphydf Understood.
Toxcore itself doesn't use this data structure. Only toxav does, so now toxav owns the code for it.
Toxcore itself doesn't use this data structure. Only toxav does, so now
toxav owns the code for it.