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

Implement C stacks #991

Closed
pcwalton opened this issue Sep 28, 2011 · 3 comments
Closed

Implement C stacks #991

pcwalton opened this issue Sep 28, 2011 · 3 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@pcwalton
Copy link
Contributor

We need C stacks before stack growth will be feasible. We statically know whenever we're calling a C function; this allows us to get away with not having linker support, as the LLVM __morestack stuff requires. There will be one C stack per Rust thread. Calling a C function switches stacks, copies arguments over, calls, and then returns the return vale.

@pcwalton
Copy link
Contributor Author

pcwalton commented Oct 1, 2011

This is implemented. LLVM code is using it. It seemed to wedge the Mac tinderbox for some reason, although it works on my Mac.

What needs to be done now is to convert all cdecl native calls over to using the C stack and implement a C-stack-switching stdcall ABI for the couple of Windows functions that use it.

@brson
Copy link
Contributor

brson commented Oct 27, 2011

This is almost complete. I believe we have 3 functions that yield still using the rust stack. We should sort that out, then get rid of the old "cdecl" ABI and rename the "c-stack-cdecl" to "cdecl" (or just make it the default).

@brson
Copy link
Contributor

brson commented Nov 10, 2011

Done.

@brson brson closed this as completed Nov 10, 2011
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* use getCalledFunction
coastalwhite pushed a commit to coastalwhite/rust that referenced this issue Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
Projects
None yet
Development

No branches or pull requests

2 participants