1 // A loadable module with a large thread local section, which would require 2 // allocation of a new TLS storage chunk when loaded with dlopen(). We use it 3 // to test the reachability of such chunks in LSan tests. 4 5 // This must be large enough that it doesn't fit into preallocated static TLS 6 // space (see STATIC_TLS_SURPLUS in glibc). 7 __thread void *huge_thread_local_array[(1 << 20) / sizeof(void *)]; // NOLINT 8 9 extern "C" void **StoreToTLS(void *p) { 10 huge_thread_local_array[0] = p; 11 return &huge_thread_local_array[0]; 12 } 13