jemalloc/test/unit
Slobodan Predolac fb5499aa9c Handle jemalloc calls after TSD teardown
This only changes behavior for the tsd_generic path, where
pthread_getspecific() can report no TSD after the pthread key destructor
has finished.  Other TSD backends keep tsd_teardown_done() as a constant
false, so the added checks compile out there.

Avoid recreating TSD for late deallocations.  Preserve existing
reincarnation behavior for late allocations and nonzero reallocations.

Add Linux CI coverage for force_tls=0, with and without --enable-debug,
to exercise the Android-equivalent generic TSD path.
2026-07-09 11:30:15 -04:00
..
a0.c Improve unit test coverage for jemalloc_init, arenas_management, and jemalloc_fork modules 2026-04-30 15:17:18 -04:00
arena_decay.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
arena_decay.sh Allow opt.tcache_max to accept small size classes. 2020-10-24 20:43:44 -07:00
arena_reset.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
arena_reset_prof.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arena_reset_prof.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arenas_management.c Replace arena->tcache_ql with cache_bin_array_descriptor_ql walks 2026-05-13 17:50:41 -04:00
atomic.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread_enable.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread_init.c Fix background thread initialization race 2026-03-10 18:14:33 -07:00
base.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
bin.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
binshard.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
binshard.sh Fix binshard.sh by specifying bin_shards for all sizes. 2025-05-28 19:21:49 -07:00
bit_util.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
bitmap.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
buf_writer.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
cache_bin.c Remove batch_alloc API 2026-05-22 23:34:10 -07:00
ckh.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
conf.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_0.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_1.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_confirm.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_parse.c Fix conf_handle_char_p zero-sized dest and remove unused conf_handle_unsigned 2026-04-01 23:15:19 -04:00
counter.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
decay.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
div.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
double_free.c Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
double_free.h Eagerly detect double free and sized dealloc bugs for large sizes. 2020-10-15 10:03:16 -07:00
edata_cache.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
emap.c Improve unit test coverage in tcache, pac, hpa_central 2026-06-01 18:18:31 -04:00
emitter.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
eset.c Improve unit test coverage in tcache, pac, hpa_central 2026-06-01 18:18:31 -04:00
extent_alloc_flags.c Introduce pinned extents to contain unpurgeable pages 2026-05-05 10:44:28 -07:00
extent_dss.c Add DSS allocation path unit tests 2026-05-12 13:14:39 -04:00
extent_quantize.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
fb.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
fork.c Add follow-up test for postfork multithread 2026-05-20 08:57:37 -04:00
fxp.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
hash.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
hpa.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
hpa.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_background_thread.c Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
hpa_background_thread.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_central.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
hpa_pageslab_packing.c Fix psset_enumerate_search pages-vs-bytes comparison 2026-05-21 13:07:08 -07:00
hpa_sec_integration.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
hpa_sec_integration.sh [SEC] Make SEC owned by hpa_shard, simplify the code, add stats, lock per bin 2026-03-10 18:14:33 -07:00
hpa_thp_always.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
hpa_thp_always.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_vectorized_madvise.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
hpa_vectorized_madvise.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_vectorized_madvise_large_batch.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
hpa_vectorized_madvise_large_batch.sh [process_madvise] Use process_madvise across multiple huge_pages 2025-04-25 19:19:03 -07:00
hpdata.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
huge.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
inspect.c Remove utilization query mallctl 2026-06-02 13:24:23 -04:00
inspect.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
jemalloc_init.c Hide methods from jemalloc_init.h that are not used in other units 2026-05-11 16:23:09 -07:00
json_stats.c Use SEC in PAC to reduce lock contention on the ecaches 2026-06-24 10:54:34 -07:00
junk.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
junk.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_alloc.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_alloc.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
large_ralloc.c Fix missing negation in large_ralloc_no_move usize_min fallback 2026-04-01 23:15:19 -04:00
log.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mallctl.c Remove experimental_hpa_max_purge_nhp option 2026-06-27 22:57:48 -04:00
malloc_conf_2.c Internalize malloc_conf_2_conf_harder ctl 2026-06-02 13:24:23 -04:00
malloc_conf_2.sh Add malloc_conf_2_conf_harder 2020-03-31 06:25:08 -07:00
malloc_dispatch.c Move malloc routing into new malloc_dispatch module 2026-06-04 11:32:53 -04:00
malloc_io.c Fix out-of-bounds write in malloc_vsnprintf when size is 0 2026-04-01 23:15:19 -04:00
math.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mpsc_queue.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mq.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mtx.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
ncached_max.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
nstime.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
oversize_threshold.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
pa.c Fix missing release of acquired neighbor edata in extent_try_coalesce_impl 2026-04-01 23:15:19 -04:00
pac.c Improve unit test coverage in tcache, pac, hpa_central 2026-06-01 18:18:31 -04:00
pac_sec_integration.c Use SEC in PAC to reduce lock contention on the ecaches 2026-06-24 10:54:34 -07:00
pack.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
pack.sh Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
pages.c Refactor init_system_thp_mode and print it in malloc stats. 2026-03-10 18:14:33 -07:00
peak.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
ph.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prng.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_accum.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_accum.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_active.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_active.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_gdump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_gdump.sh Enable heap profiling on MacOS 2024-04-09 12:57:01 -07:00
prof_hook.c Replace ctl mallctl macros with helper functions 2026-06-06 10:01:00 -04:00
prof_hook.sh Making jemalloc max stack depth a runtime option 2022-09-12 13:56:22 -07:00
prof_idump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_idump.sh Remove --disable-tcache. 2017-04-21 10:06:12 -07:00
prof_log.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_log.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_mdump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_mdump.sh Push error handling logic out of core dumping logic 2020-06-29 14:27:50 -07:00
prof_recent.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_recent.sh Add the prof_sys_thread_name feature in the prof_recent unit test. 2023-05-11 09:10:57 -07:00
prof_reset.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_reset.sh Last-N profiling mode 2019-12-30 15:58:57 -08:00
prof_small.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_small.sh Add a test-case for small profiled allocations 2023-07-03 16:19:06 -07:00
prof_stats.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_stats.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_sys_thread_name.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_sys_thread_name.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_tctx.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
prof_tctx.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_thread_name.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_thread_name.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
psset.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
ql.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
qr.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
rb.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
retained.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
rtree.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
safety_check.c Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
safety_check.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
san.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
san.sh San: Rename 'guard' to 'san' 2021-12-15 10:39:17 -08:00
san_bump.c Consolidate arena_* header split into arena.h 2026-06-04 11:32:53 -04:00
sc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sec.c Use SEC in PAC to reduce lock contention on the ecaches 2026-06-24 10:54:34 -07:00
SFMT.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
size_check.c Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
size_check.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
size_classes.c Fix numeric overflow checks in size classes 2026-05-27 11:39:04 -04:00
size_classes.sh Renaming limit_usize_gap to disable_large_size_classes 2025-05-06 14:47:35 -07:00
slab.c Consolidate simple component headers (large, background_thread, bin) 2026-06-04 11:32:53 -04:00
smoothstep.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
spin.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
stats.c Consolidate arena_* header split into arena.h 2026-06-04 11:32:53 -04:00
stats_print.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sz.c De-export test-only helpers via JET_EXTERN / #ifdef JEMALLOC_JET; declare in unit tests, not headers 2026-06-11 11:45:05 -04:00
tcache_gc.c Replace JET_WRAP_ with JET_EXTERN_INLINE macro 2026-06-18 13:02:23 -04:00
tcache_init.c Handle tcache init failures gracefully 2026-03-10 18:14:33 -07:00
tcache_max.c Fix large alloc nrequests under-counting on cache misses 2026-04-01 23:15:19 -04:00
tcache_max.sh skip tcache GC for tcache_max unit test 2024-06-25 12:59:45 -07:00
test_hooks.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
thread_event.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
thread_event.sh Build a general purpose thread event handler 2019-11-04 11:15:50 -08:00
ticker.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
tsd.c Handle jemalloc calls after TSD teardown 2026-07-09 11:30:15 -04:00
uaf.c Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
witness.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
zero_realloc_abort.c Remove safety check abort mallctl 2026-06-02 13:24:23 -04:00
zero_realloc_abort.sh Realloc: Make behavior of realloc(ptr, 0) configurable. 2019-10-29 17:48:44 -07:00
zero_realloc_alloc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_alloc.sh Rename zero_realloc option "strict" to "alloc". 2022-04-20 10:27:25 -07:00
zero_realloc_free.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_free.sh Realloc: Make behavior of realloc(ptr, 0) configurable. 2019-10-29 17:48:44 -07:00
zero_reallocs.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_reallocs.sh Add stats counters for number of zero reallocs 2019-10-29 17:48:44 -07:00