jemalloc/test/unit
Slobodan Predolac a54018337c Consolidate arena_* header split into arena.h
arena_types.h + arena_structs.h + arena_externs.h merged into arena.h,
keeping the three logical sections (TYPES / STRUCTS / EXTERNS) with
explicit dividers.  arena_inlines_a.h and arena_inlines_b.h stay
separate; arena_inlines_b.h now carries a comment explaining why
merging the two would reintroduce a real #include cycle through
tcache_inlines.h -> arena_choose (the asymmetric cycle-breaker).

Two ordering gotchas this consolidation surfaced:

1. tsd_internals.h is included from tsd.h via tsd_generic.h, sometimes
   long before arena.h is loaded (e.g. ckh.c includes ckh.h -> tsd.h
   before jemalloc_internal_includes.h).  TSD_INITIALIZER's expansion
   in tsd_generic.h's function bodies references
   ARENA_DECAY_NTICKS_PER_UPDATE, so it must already be defined.
   Factor the constant into a new minimal header,
   arena_decay_constants.h, that pulls nothing but jemalloc_preamble.h,
   and include it from both arena.h and tsd_internals.h.  arena_t is
   still added as a forward decl in tsd_internals.h -- including
   arena.h there would trigger arena_stats.h -> mutex.h -> tsd.h ->
   re-entry into this very file.

2. extent_dss.h previously included arena_types.h for the arena_t
   pointer type, but arena.h now includes extent_dss.h (it was a
   STRUCTS-section dep).  Forward-decl arena_t in extent_dss.h to
   break that cycle.

Additional forward decls in tcache.h and large.h (arena_t *).  These
were previously satisfied by the master include order loading
arena_types.h before everything else; with arena.h now in the EXTERNS
section, large.h and tcache.h are parsed earlier than arena.h, so
they need to declare arena_t themselves.

jemalloc_internal_externs.h's #include of arena_types.h was
vestigial -- the file uses no arena symbols.  Dropped.
2026-05-29 08:53:58 -07: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
arena_reset.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
arena_reset_prof.c
arena_reset_prof.sh
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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
bin.c Consolidate simple component headers (large, background_thread, bin) 2026-05-29 08:53:23 -07: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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
buf_writer.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
cache_bin.c Remove batch_alloc API 2026-05-22 23:34:10 -07:00
ckh.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
double_free.h
edata_cache.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
emitter.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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 Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07: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_pageslab_packing.c Fix psset_enumerate_search pages-vs-bytes comparison 2026-05-21 13:07:08 -07:00
hpa_sec_integration.c Remove hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07: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 Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07: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 Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07: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 dead pai_t field and delete pai.h 2026-05-12 13:43:16 -07: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 [HPA] Add ability to start page as huge and more flexibility for purging 2026-03-10 18:14:33 -07:00
huge.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
inspect.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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 Emit retained HPA slab stats in JSON 2026-04-01 23:15:19 -04:00
junk.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
junk.sh
junk_alloc.c
junk_alloc.sh
junk_free.c
junk_free.sh
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 hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07:00
malloc_conf_2.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
malloc_conf_2.sh
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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
pack.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
pack.sh
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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_accum.sh
prof_active.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
prof_log.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
prof_recent.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_reset.sh
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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
psset.c Fix psset_pick_purge when last candidate with index 0 dirtiness is ineligible 2026-03-26 10:39:37 -07: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 Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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-05-29 08:53:58 -07:00
sc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sec.c Remove hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07:00
SFMT.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
size_check.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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-05-29 08:53:23 -07: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-05-29 08:53:58 -07:00
stats_print.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sz.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
ticker.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
tsd.c Remove generic experimental hooks 2026-05-13 18:27:43 -04:00
uaf.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07: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
zero_realloc_abort.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_abort.sh
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
zero_reallocs.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_reallocs.sh