Use a M:N caches-to-lifetimes in SingletonThreadLocal
Summary: [Folly] Use a M:N caches-to-lifetimes in `SingletonThreadLocal`. Sometimes the compiler will not merge cache and lifetime thread-local variables in expected ways, so be resilient. More details in #1135 and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90562. At the same time, move the tracking into the wrapper. The lifetime was an intrusively-linked-list node which was clever and which was allocation-free but which increased the TLS requirement per instantiation of `SingletonThreadLocal`. Moving the tracking into the wrapper decreases the TLS requirement, although the tracking now requires heap allocations. Fixes #1135. Closes #1138. Reviewed By: andriigrynenko Differential Revision: D15508024 fbshipit-source-id: a344e8dd52bd52724ad85b0fc88d6a2a349952ac
Showing
Please register or sign in to comment