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

Move ring buffer out of toxcore/util into toxav. #163

Merged
merged 1 commit into from
Sep 24, 2016

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Sep 22, 2016

Toxcore itself doesn't use this data structure. Only toxav does, so now
toxav owns the code for it.

// 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

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link

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?

Copy link
Member Author

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

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.

Copy link
Member Author

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.

Copy link

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.

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

@GrayHatter GrayHatter self-assigned this Sep 23, 2016
// 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
Copy link
Member

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.

Copy link

@mannol mannol left a 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
Copy link

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
Copy link

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?

@iphydf iphydf force-pushed the ringbuffer branch 3 times, most recently from 25c2694 to 311fbce Compare September 24, 2016 14:57
@iphydf
Copy link
Member Author

iphydf commented Sep 24, 2016

Since I can't reply to the review thread (@mannol do you still like github reviews better than reviewable?):

  • What's the need for ring buffer: I don't know, it's used for something, so I'm making it work.

@mannol
Copy link

mannol commented Sep 24, 2016

I do. We should just avoid force pushing; at least until the review is complete.
I'm not asking about the need for ring buffer, I'm asking why isn't #include "ring_buffer.h" sufficient? Symbols should be defined in libtoxav.*.

@iphydf
Copy link
Member Author

iphydf commented Sep 24, 2016

The symbols are not part of the ABI, and since #117, toxav does not export those symbols in the .so file anymore (on linux).

Copy link

@mannol mannol left a 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.
@iphydf iphydf merged commit f60900c into TokTok:master Sep 24, 2016
@iphydf iphydf deleted the ringbuffer branch October 18, 2016 11:13
@iphydf iphydf modified the milestone: v0.0.1 Nov 5, 2016
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

Successfully merging this pull request may close these issues.

None yet

5 participants