-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Remove remaining uses of setErrNo and deprecate SUPPORT_ERRNO setting #21074
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
2d81085
to
e7f5566
Compare
so IIUC what's really happening here is that C runtime functions are all still setting errno where appropriate but errno is basically not exposed to JS and there are no JS functions that need to set it, and therefore we don't need to have the function for setting it from JS. So the setting was always a bit of a misnomer? |
Yes, IIUC traditionally C function always set The As far as I can tell there is no code size regression from making malloc/sbrk just like the rest of libc. |
I think the reason we don't see any code size regressions from having malloc/sbrk reference errno is that its almost impossible to build a native program without any errno references. Even The cost of supporting errno on the native side is tiny and likely very hard to avoid. |
a7cc04b
to
97e3b0d
Compare
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.
lgtm % comments/questions
ChangeLog.md
Outdated
@@ -20,6 +20,10 @@ See docs/process.md for more on how version tagging works. | |||
|
|||
3.1.52 (in development) | |||
----------------------- | |||
- The `ERRNO_SUPPORT` setting is now deprecated since the `setErrNo` function | |||
that it controls is no longer used by emscripten. Use of `errno` from in C |
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.
that it controls is no longer used by emscripten. Use of `errno` from in C | |
that it controls is no longer used by emscripten. Use of `errno` from C |
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.
Makes sense, thanks for checking that.
Seems reasonable given emmalloc is our compact allocator, so as long as we don't regress that sgtm.
e1f3e30
to
3a0a73d
Compare
Aside from the `setErrNo` library function `SUPPORT_ERRNO` also controlled the building the malloc and sbrk. However, just setting errno to ENOMEM didn't seem to have any effect on the code size for any of our micro benchmarks. This may be because LTO can completely eliminate the write to `errno` when there are no readers, or it could be that errno usage exists in in even the smallest program already so removing from malloc alone makes no difference.
Aside from the
setErrNo
library functionSUPPORT_ERRNO
also controlled the building the malloc and sbrk. However, just setting errno to ENOMEM didn't seem to have any effect on the code size for any of our micro benchmarks. This may be because LTO can completely eliminate the write toerrno
when there are no readers, or it could be that errno usage exists in in even the smallest program already so removing from malloc alone makes no difference.