[cxx-abi-dev] thread_local CONstructors

Jason Merrill jason at redhat.com
Wed Sep 26 21:03:02 UTC 2012


On 09/26/2012 10:59 AM, Richard Henderson wrote:
> Which means that one call to __tls_get_addr can be shared for the lookup of I and I_DONE.

I suppose tweaking the wrapper to

extern int& i_init() __attribute__ ((weak));
inline int& i_wrapper()
{
   if (i_init)
     return i_init();
   else
     return i;
}

would avoid looking up the TLS address on both sides of the call to i_init.

Jason



More information about the cxx-abi-dev mailing list