gperftools/vsprojects
Aliaksey Kandratsenka 6691226953 split and rewrite TLS access for thread caches
Logic was removed from thread_cache.{h,cc} into
thread_cache_ptr.{h,cc}.

Separation will help possible future evolution, and we already changed
the logic quite a bit:

* early access (when TLS isn't initialized yet) now uses global
ThreadCache instance. We therefore have ThreadCachePtr instances
managing required locking. This eliminates unnecessary complication of
PTHREADS_CRASHES_IF_RUN_TOO_EARLY logic, and any other danger of
touching TLS too early. BTW previous implementation actually leaked
initial early-initialized ThreadCache instance(!)

* old configure-time HAVE_TLS logic is amputated. Config-time part of
it made little sense as C++ 17 guarantees availability of
thread_local, but we have manually curated deny-list of "bad" OSes,
that we tested (via compile checks!) at configure time. Now this
is all compile time. There is now compile-time kHaveGoodTLS variable
and we're using it mostly via if constexpr.

* kHaveGoodTLS case of creating thread cache is simplified and made
more straightforward (no need to have in_setspecific logic).

* !kHaveGoodTLS case if fixed and improved too. We avoid
std:🧵:get_id, as it deadlocks on mingw. We use errno address as
a portable and (usually) async-signal safe 'my thread' identifier. We
also eliminate linear searching of thread's cache and replace it with
straightforward hash table lookup.
2024-02-03 15:57:14 -05:00
..
addr2line-pdb bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
addressmap_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
current_allocated_bytes_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
frag_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
include split and rewrite TLS access for thread caches 2024-02-03 15:57:14 -05:00
libtcmalloc_minimal split and rewrite TLS access for thread caches 2024-02-03 15:57:14 -05:00
low_level_alloc_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
malloc_extension_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
malloc_hook_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
markidle_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
nm-pdb bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
packed-cache_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
page_heap_test split and rewrite TLS access for thread caches 2024-02-03 15:57:14 -05:00
pagemap_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
preamble_patcher_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
realloc_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
sampler_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
stack_trace_table_test bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
system-alloc_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
tcmalloc_minimal_large bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
tcmalloc_minimal_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
thread_dealloc_unittest bump msvc projects to VS2019 and c++ 17 2024-01-30 15:54:24 -05:00
common.vcxproj.props A number of cleanups 2024-01-29 17:15:53 -08:00