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

Lower initial memory, with runtime config to set higher #164

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

samwillis
Copy link
Collaborator

@samwillis samwillis commented Aug 11, 2024

On mobile there can be a lower available memory, this sets the compile time INITIAL_MEMORY lower, then allows the user to specify a higher initial memory at runtime.

The enscripten generated source include this:

    if (Module['wasmMemory']) {
      wasmMemory = Module['wasmMemory']
    } else {
      var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 268435456
      wasmMemory = new WebAssembly.Memory({
        initial: INITIAL_MEMORY / 65536,
        maximum: 2147483648 / 65536,
      })
    }

Copy link
Contributor

github-actions bot commented Aug 11, 2024

@github-actions github-actions bot temporarily deployed to pull request August 11, 2024 17:38 Inactive
@samwillis samwillis changed the title wip Lower initial memory, with runtime config to set higher Aug 11, 2024
@samwillis samwillis marked this pull request as ready for review August 11, 2024 18:44
@github-actions github-actions bot temporarily deployed to pull request August 11, 2024 18:51 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 11, 2024 19:18 Inactive
@samwillis samwillis requested a review from pmp-p August 11, 2024 21:03
@pmp-p pmp-p merged commit 386cdb9 into main Aug 11, 2024
2 checks passed
@pmp-p pmp-p deleted the samwillis/mem-experiments branch August 11, 2024 23:34
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

Successfully merging this pull request may close these issues.

2 participants