4684ddb6aa
- import libcxx - reduce targets to the one when compiled as a tools Change-Id: Iabb8427f80ff8e89463559a28bcb8b4f2bdbc496
12 lines
528 B
C++
12 lines
528 B
C++
// A loadable module with a large thread local section, which would require
|
|
// allocation of a new TLS storage chunk when loaded with dlopen(). We use it
|
|
// to test the reachability of such chunks in LSan tests.
|
|
|
|
// This must be large enough that it doesn't fit into preallocated static TLS
|
|
// space (see STATIC_TLS_SURPLUS in glibc).
|
|
__thread void *huge_thread_local_array[(1 << 20) / sizeof(void *)]; // NOLINT
|
|
|
|
extern "C" void **StoreToTLS(void *p) {
|
|
huge_thread_local_array[0] = p;
|
|
return &huge_thread_local_array[0];
|
|
}
|