mirror of
https://github.com/gperftools/gperftools
synced 2025-02-27 09:30:25 +00:00
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.
|
||
---|---|---|
.. | ||
addr2line-pdb | ||
addressmap_unittest | ||
current_allocated_bytes_test | ||
frag_unittest | ||
include | ||
libtcmalloc_minimal | ||
low_level_alloc_unittest | ||
malloc_extension_test | ||
malloc_hook_test | ||
markidle_unittest | ||
nm-pdb | ||
packed-cache_test | ||
page_heap_test | ||
pagemap_unittest | ||
preamble_patcher_test | ||
realloc_unittest | ||
sampler_test | ||
stack_trace_table_test | ||
system-alloc_unittest | ||
tcmalloc_minimal_large | ||
tcmalloc_minimal_unittest | ||
thread_dealloc_unittest | ||
common.vcxproj.props |