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

Write swap in assembly instead of C++ #548

Closed
eholk opened this issue Jun 22, 2011 · 2 comments
Closed

Write swap in assembly instead of C++ #548

eholk opened this issue Jun 22, 2011 · 2 comments

Comments

@eholk
Copy link
Contributor

eholk commented Jun 22, 2011

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.

@ghost ghost assigned eholk Jun 22, 2011
@marijnh
Copy link
Contributor

marijnh commented Jun 23, 2011

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.

@eholk
Copy link
Contributor Author

eholk commented Jun 23, 2011

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?

@eholk eholk closed this as completed in 98dee91 Jun 24, 2011
@eholk eholk removed their assignment Jun 16, 2014
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
…roid, r=alexcrichton

Fixed missing EPOLLONESHOT for android

resolve rust-lang#548
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this issue Sep 27, 2024
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

2 participants