]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #99553 - ChrisDenton:lazy-compat-fn, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Sun, 31 Jul 2022 10:44:11 +0000 (10:44 +0000)
committerbors <bors@rust-lang.org>
Sun, 31 Jul 2022 10:44:11 +0000 (10:44 +0000)
commit76822a28780a9a93be04409e52c5df21663aab97
tree7406e364a2ebce5311f085ba23ee7394bb5bd176
parent482153bc208df5fc236cc0e1cddb24e93fcc332f
parent698d4a86c647e4dd44eb83fc717d48153b82bd6c
Auto merge of #99553 - ChrisDenton:lazy-compat-fn, r=Mark-Simulacrum

Rewrite Windows `compat_fn` macro

This allows using most delay loaded functions before the init code initializes them. It also only preloads a select few functions, rather than all functions.

This is optimized for the common case where a function is used after already being loaded (or failed to load). The only change in codegen at the call site is to use an atomic load instead of a plain load, which should have negligible or no impact.

I've split the old `compat_fn` macro in two so as not to mix two different use cases. If/when Windows 7 support is dropped `compat_fn_optional` can be removed entirely.

r? rust-lang/libs