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

is allocateUTF8 safe to use ? #9786

Open
lovasoa opened this issue Nov 5, 2019 · 9 comments
Open

is allocateUTF8 safe to use ? #9786

lovasoa opened this issue Nov 5, 2019 · 9 comments

Comments

@lovasoa
Copy link
Contributor

lovasoa commented Nov 5, 2019

In sql.js, we use the allocateUTF8OnStack function, and it works. However, the function is nowhere to be found in the official API documentation. Is this an oversight, or is there a reason the function should not be used outside of emscripten itself ?

@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 5, 2019

We also use stackSave and stackRestore. Is there a reason they are not documented ?

@stale
Copy link

stale bot commented Nov 5, 2020

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Nov 5, 2020
@lovasoa
Copy link
Contributor Author

lovasoa commented Nov 5, 2020

@kripken ?

@stale stale bot removed the wontfix label Nov 5, 2020
@kripken
Copy link
Member

kripken commented Nov 5, 2020

I don't think there's a reason they are not documented. They are internal APIs so they may change in theory, but they have also been part of the internal API for quite a long time.

Hopefully someone will add docs, I'll add some tags to this issue.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Apr 17, 2022
@dhdaines
Copy link

Well, these functions seem to have disappeared, so I guess we weren't supposed to use them?

Can anybody suggest any alternative, or am I just too dense to decipher the (lack of) documentation that will tell me how to access them from a pre-js or post-js?

@stale stale bot removed the wontfix label Oct 18, 2022
@dhdaines
Copy link

Added a comment about this on #17403 which seems to be the culprit here. If there's a workaround please let me know.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 18, 2022

These days you need to explicitly opt into these library functions:

emscripten/ChangeLog.md

Lines 70 to 73 in 7b9747e

- The `LEGACY_RUNTIME` setting is no longer enabled by default. If you use any
of these legacy runtime functions (except in library code with explicit
dependencies) then you would need to set `LEGACY_RUNTIME` on the command line
or add the ones you need to `DEFAULT_LIBRARY_FUNCS_TO_INCLUDE`:

@dhdaines
Copy link

Thanks! You should mention somewhere that they also need the leading dollar sign...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants