-
Notifications
You must be signed in to change notification settings - Fork 1k
add __errno, _alloc, and __disable_interrupts foreign procedure conventions
#1013
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
base: main
Are you sure you want to change the base?
Conversation
bb714f5 to
18526d8
Compare
The `__errno` convention makes a call for a foreign procedure return two values: the foreign procedure's direct result and the value of `errno` right after the foreign procedure returns. On Windows, `current-errno-source` selects which `errno` is used for `__errno`. Also, `__get_last_error` is available as an alternative to `__errno`.
Co-authored-by: Jamie Taylor <jltaylor-us@users.noreply.github.com>
Use `__atomic` or `__atomic __alloc` for many foreign procedures that are used by the system, which can speed up some individual operations by 5-10%.
The `__disable_interrupts` convention is intended mainly for callables, where interrupts are disabled before the callable gets control and reenabled after the callable returns.
__errno foreign procedure convention__errno, _alloc, and __disable_interrupts foreign procedure conventions
|
The latest revision includes two more commits for two more conventions:
The commit to add |
|
Here's how I measured the performance effect of |
The
__errnoconvention makes a call for a foreign procedure return two values: the foreign procedure's direct result and the value oferrnoright after the foreign procedure returns.On Windows,
current-errno-sourceselects whicherrnois used for__errno. Also,__get_last_erroris available as an alternative to__errno.Since all backends are affected, I ran at least the
foreign.mstest on all architecture+ABI combinations.