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

Consolidate Stack #24

Open
danielstuart14 opened this issue Oct 7, 2024 · 1 comment
Open

Consolidate Stack #24

danielstuart14 opened this issue Oct 7, 2024 · 1 comment

Comments

@danielstuart14
Copy link
Contributor

Currently, tinywasm uses multiple vectors to store the stack values for each type size supported (

).

This increases the default stack size by a lot, which makes it difficult to use tinywasm on restrained devices (ex: MCUs).

Is it something desired for the stacks to be consolidated into a single one?

I can think of some ways to do it, but a deeper discussion should be done.

@explodingcamera
Copy link
Owner

I've been planning to add some config options for the initial stack sizes when initializing stores that hopefully should mostly solve this in the short term.
The main reason for this Struct of Arrays pattern for the stack is to allow for using native rust number/simd types for the stack values instead of having to hope the rust compiler turns the byte conversions into transmutes. This also depends on the alignment so probably wouldn't be very efficient if everything shared the same stack without adding a lot of memory usage by padding everything (which was the previous solution i used). I'd be also open for other ideas, it's not super ergonomic/efficient to have to pass around 4 different stack pointers everywhere.

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