-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Write swap in assembly instead of C++ #548
Comments
Could you write it in LLVM bitcode instead? I think we're hoping to use as little assembly as possible, in order to make supporting different processor types easy. |
My first thought was no, because swapping contexts needs direct access to the machine's registers. However, we already have set_registers and get_registers written in assembly, so we could probably write the swap function in LLVM. If we do this, can we guarantee that LLVM won't turn the call to set_registers into a tail call like is happening in the C version? |
…roid, r=alexcrichton Fixed missing EPOLLONESHOT for android resolve rust-lang#548
Co-authored-by: Ubuntu <ubuntu@ip-172-31-14-11.ec2.internal>
Right now, C++ compilers like to make set_registers into a tail call, which causes problems when get_registers returns the second time. To get around this, we should write the swap context function in assembly instead of disabling compiler optimizations.
The text was updated successfully, but these errors were encountered: