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

log error if value accessed in ErrorOrValue when error != OK #76

Closed
philburk opened this issue Apr 1, 2018 · 4 comments
Closed

log error if value accessed in ErrorOrValue when error != OK #76

philburk opened this issue Apr 1, 2018 · 4 comments
Assignees

Comments

@philburk
Copy link
Collaborator

philburk commented Apr 1, 2018

Suggested by Mikhail so that we can tell if a caller is ignoring the error return value.

@dturner
Copy link
Collaborator

dturner commented Jun 15, 2018

I'm not sure this is such a good idea, we'd be adding a check to every call to ResultWithValue::value() which might introduce unnecessary overhead in a real-time system. Isn't it the caller's responsibility to check the result before checking the value?

@mnaganov
Copy link
Collaborator

How much overhead an integer comparison adds? Also, I'm not aware of any methods in Oboe that need to be called in a tight loop.

I agree it's caller's responsibility to check for the return code, but when they forget to do that and something is not working, checking the log and seeing that there was an error is a great help for them.

@dturner dturner assigned dturner and unassigned philburk Jun 20, 2018
@dturner dturner modified the milestone: v1.0 Jun 20, 2018
@dturner
Copy link
Collaborator

dturner commented Jun 20, 2018

Phil and I have some concerns about the extra overhead which would be introduced by branching, especially when some get methods (e.g. getXRunCount) might be called on every callback.

@philburk
Copy link
Collaborator Author

philburk commented Oct 2, 2018

I am more concerned about suddenly flooding the logcat with error messages. For example, if getXRunCount() returns zero value because it is not supported, then no big deal.

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