Files
rust/library/std/src
Matthias Krüger b2a8d9d86c Rollup merge of #100984 - ChrisDenton:reinstate-init, r=Mark-Simulacrum
Reinstate preloading of some dll imports

I've now come around to the conclusion that there is a justification for pre-loading the synchronization functions `WaitOnAddress` and `WakeByAddressSingle`. I've found this to have a particularly impact in testing frameworks that may have short lived processes which immediately spawn lots of threads.

Also, because pre-main initializers imply a single-threaded environment, we can switch back to using relaxed atomics which might be a minor perf improvement on some platforms (though I doubt it's particularly notable).

r? ``@Mark-Simulacrum`` and sorry for the churn here.

For convenience I'll summarise previous issues with preloading and the solutions that are included in this PR (if any):

**Issue:** User pre-main initializers may be run before std's
**Solution:** The std now uses initializers that are guaranteed to run earlier than the old initializers. A note is also added that users should not copy std's behaviour if they want to ensure they run their initializers after std.

**Issue:** Miri does not understand pre-main initializers.
**Solution:** For miri only, run the function loading lazily instead.

**Issue:** We should ideally use `LoadLibrary` to get "api-ms-win-core-synch-l1-2-0". Only "ntdll" and "kernel32" are guaranteed to always be loaded.
**Solution:** None. We can't use `LoadLibrary` pre-main. However, in the past `GetModuleHandle` has always worked in practice so this should hopefully not be a problem.

If/when Windows 7 support is dropped, we can finally remove all this for good and just use normal imports.
2022-08-31 07:57:55 +02:00
..
2022-08-22 13:28:25 -07:00
2022-08-01 20:10:40 +00:00
2022-07-18 15:06:07 +01:00
2022-08-18 18:07:39 -04:00
2022-05-27 07:36:17 -04:00
2022-03-23 05:33:44 +00:00
2022-08-18 18:07:39 -04:00
2022-08-18 18:07:39 -04:00
2022-06-26 16:31:29 +02:00
2022-04-14 01:33:13 -04:00
2022-05-24 19:41:40 -07:00
2022-08-25 07:42:07 +01:00