-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Move loading of initial dynamic libraries to before run
. NFC
#19450
Conversation
run
run
. NFC
51912b9
to
e9db663
Compare
Previously we were calling `loadDylibs` in the `run` function but we can call it earlier as soon as the main module is instantiated. This saves a little on code size since it relies on the existing `runDependencies` mechanism. Split out from #19390
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 am slightly fuzzy on the big picture here, but this looks simpler and better.
@@ -21,6 +21,7 @@ | |||
// new function with an '_', it will not be found. | |||
|
|||
mergeInto(LibraryManager.library, { | |||
|
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.
if (!ENVIRONMENT_IS_PTHREAD || runtimeInitialized) | ||
#endif | ||
// If the runtime has already been initialized we set the stack limits | ||
// now. Othwerwise this is delayed until `setDylinkStackLimits` is |
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.
// now. Othwerwise this is delayed until `setDylinkStackLimits` is | |
// now. Otherwise this is delayed until `setDylinkStackLimits` is |
Indeed, there are some subtle timing/ordering details here, but I'm really glad your pushed me to factor this PR out of the other once, since it helped me understand them better and make this PR into something that is good to land regardless. |
Previously we were calling
loadDylibs
in therun
function but we can call it earlier as soon as the main module is instantiated. This saves a little on code size since it relies on the existingrunDependencies
mechanism.Split out from #19390