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

[browser] fix 4GB JS interop #109079

Merged
merged 10 commits into from
Oct 31, 2024
Merged

[browser] fix 4GB JS interop #109079

merged 10 commits into from
Oct 31, 2024

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Oct 21, 2024

This is use on your own risk

Even when we try to make this work, we do not think it's good idea to allocate more than 256MB in a web page.

  • add new malloc which is wrapper over Module._malloc that returns uint32 rather than negative number above 2GB
  • fix receiving pointers when calling to JS on via ICALL
  • fix marshaling IntPtr as uint32 to JS, because typically it's used as offset to array
  • add Module parameter to preRun and other emscripten events. So that it could be used to test memory.
  • improved MemoryTest WBT to waste 2GB before starting the mono runtime.

@pavelsavara pavelsavara marked this pull request as ready for review October 24, 2024 17:17
@pavelsavara pavelsavara requested review from kg, maraf and ilonatommy and removed request for lewing, maraf and ilonatommy October 24, 2024 17:17
Copy link
Member

@kg kg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the incremental improvements you're making while doing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants