Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #125525 - joboet:tls_accessor, r=cuviper
Make TLS accessors closures that return pointers The current TLS macros generate a function that returns an `Option<&'static T>`. This is both risky as we lie about lifetimes, and necessitates that those functions are `unsafe`. By returning a `*const T` instead, the accessor function do not have safety requirements any longer and can be made closures without hassle. This PR does exactly that! For native TLS, the closure approach makes it trivial to select the right accessor function at compile-time, which could result in a slight speed-up (I have the hope that the accessors are now simple enough for the MIR-inliner to kick in).
bors 2024-06-04
parent ff9bc88 · parent 479ac9b · commit 2a068f7
0 files changed, 0 insertions, 0 deletions