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

Stack growing support #369

Open
veluca93 opened this issue Jan 2, 2024 · 3 comments
Open

Stack growing support #369

veluca93 opened this issue Jan 2, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@veluca93
Copy link

veluca93 commented Jan 2, 2024

(perhaps this issue is better opened on the main LLVM repo)

Is it possible to support unbounded/growing stacks?

Some code makes heavy use of recursion, and having a fixed stack size is quite limiting. I had originally thought that the multiple memories proposal would help there, but that would introduce different types of pointers, which sounds like a terrible idea :-)

@sunfishcode sunfishcode added the enhancement New feature or request label Jan 2, 2024
@sunfishcode
Copy link
Member

It's theoretically possible. And yes, this would largely be an upstream LLVM feature, though depending on how it works, it may also need support from wasi-sdk/wasi-libc too.

@veluca93
Copy link
Author

veluca93 commented Jan 2, 2024

Thanks for the quick reply :-)

Are you aware of any issues/plans regarding this feature? Or even any existing implementation plans/ideas...

@sunfishcode
Copy link
Member

I'm not aware of any plans.

If you want to be sure that all code dynamically allocates more stack space instead of assuming it has enough, it seems likely that this will require adding a new ABI, a separate wasi-libc build, and thus a new wasi-sdk target.

Another potential consideration is that when wasi-libc adds setjmp support, it will need to be aware of any dynamically-allocated stack regions between the longjmp and the setjmp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants