-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Make more use of allocateUTF8 helper. NFC
#19064
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
1605839 to
984241f
Compare
0804c5b to
d94c606
Compare
d94c606 to
5122820
Compare
| // We never free the return values of this function so we need to allocate | ||
| // using builtin_malloc to avoid LSan reporting these as leaks. | ||
| emscripten_get_compiler_setting__noleakcheck: true, | ||
| #if RETAIN_COMPILER_SETTINGS |
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.
I've never heard of this setting before. Does anyone use it?
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.
It was originally added by @juj I believe so I assume they are using it for something. We use it in a few places in our test code too IIRC.
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.
I never used this function, but it was added after there were more than one report from Emscripten users that they wanted to have the ability to read this setting. Internet Archive's DosBox project may have been one if memory serves, they had a need to be able to dynamically check with builds which options were used, since they were updating games vs engines at different cadences.
If I recall, I was actually reluctant to add this setting because of the addition to preamble.js that it would incorporate, which is why it went behind a build flag so code size would not unconditionally grow for all users.
Ideally it would be great to fully move this to a library file in the same fashion you attacked some of the other functions from the preambles.
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.
Searching GitHub for uses of emscripten_get_compiler_setting does find some hits:
- https://github.com/search?q=emscripten_get_compiler_setting&type=code&p=1
- https://github.com/mame/xterm-pty/blob/abc201aeff1b4897ce4cd26a54c6c1b2aa3fc3d4/demo/build/example.c#L12
- https://github.com/renpy/renpyweb/blob/e5bad02dbf3c6fc773c438fbfea99a1151afa843/python-emscripten/emscripten.pyx#L239
5122820 to
8a08504
Compare
8a08504 to
fba10b7
Compare
The comment pertains to code that was removed in emscripten-core#19064.
The comment pertains to code that was removed in #19064.
No description provided.