Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use @IgnoreError on functions that don't need errno #6

Closed
ghost opened this Issue Apr 5, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@ghost

ghost commented Apr 5, 2013

For correctness, jnr-ffi saves the native value of errno after each function call, even if the function doesn't fail (since jnr-ffi cannot discern failure vs success of a native call).

For functions that don't set the native errno value on failure (not sure if sodium sets errno or not), you can turn off this feature to reduce the per-call overhead.

e.g. this is getpid from jnr-posix

@IgnoreError int getpid();

You can also use that annotation on the library interface if none of the functions sets errno.

@abstractj abstractj closed this May 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment