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

Faster makecontext #8

Open
tarqd opened this issue Apr 4, 2014 · 1 comment
Open

Faster makecontext #8

tarqd opened this issue Apr 4, 2014 · 1 comment
Assignees

Comments

@tarqd
Copy link

tarqd commented Apr 4, 2014

makecontext and friends have to make system calls every time they are used to store the current signal mask. Instead of using this function directly it'd be more performant to store the callee-saved registers yourself (depends on your target systems ABI).

You'd need to store any preserved registers in the table here. You can also probably skip out of preserving float registers as they are also not guaranteed to be preserved accross function calls.

You could store all registers like makecontext does but it's not necessary.

References:

@s4y s4y self-assigned this Apr 4, 2014
@tarqd
Copy link
Author

tarqd commented Apr 5, 2014

Also a good reference (with a decent license): android's bionic libc.

Code for storing registers for each arch except windows is in libc/[arch]/bionic/setjmp.S

@s4y s4y added the performance label Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants