-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove unneeded buffer global
#18454
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
Conversation
6b41fb1 to
c88c687
Compare
c483bdf to
9861cc4
Compare
c88c687 to
9dafe9b
Compare
buffer globalbuffer global
kripken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it might add a few bytes, but the simplification seems worth it.
(Removing the parameter should have decreased code size, but maybe closure was doing that all along anyhow?)
Yes, it only adds bytes in non-optimizing builds, but I also think it make non-optimized builds more readable. For optimized builds its a wash (I assume because of closure). |
|
I'm going to add a ChangeLog entry for this I think |
If this is needed it can always be found via HEAPXX, or wasmMemory. Also introduce a new debug helper called `missingGlobal` which allows use to remove builtin global symbols while notifying any folks that are depending on them.
|
This regressed Unity's end user at https://forum.unity.com/threads/arrays-shared-between-c-and-jslib-in-webgl-buffer-undefined-in-2023-3-0a6.1495094/ . In Emscripten documentation, I see there is one location that still looks like is referencing
Here’s code implementing the base64 solution::
var profile_data = new Uint8Array(buffer, ptr, len);Also, we still have the following
.. js:attribute:: Module.buffer
Allows you to provide your own ``ArrayBuffer`` or ``SharedArrayBuffer`` to use as the memory.
.. note:: This is only supported if ``-sWASM=0``. See ``Module.wasmMemory`` for WebAssembly support.
See the fields ``Module['buffer']`` and ``Module['wasmMemory']`` for more information.is the intent to get rid of In terms of code size, this PR is a pessimization. I think the code size comparison above was not apples-to-apples, due to also removing the function parameter in the PR. In small test programs, a dedicated |
|
I don't think this this change effected Looking at the codebase it doesn't look like references to |
|
The readable
|
If this is needed it can always be found via HEAPXX, or wasmMemory.
Also introduce a new debug helper called
missingGlobalwhich allowsus to remove builtin global symbols while notifying any folks that
are depending on them.