From 19978eea2fad9095a4c6634faa35e5d5b29eba70 Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Wed, 27 May 2026 19:04:11 -0400 Subject: [PATCH] Drop umbrella include from 15 more .c files (batch 4) Converted: prof_stack_range, jemalloc_fork, san, pa_extra, mutex, thread_event_registry, rtree, ehooks, pa, extent_dss, decay, large, nstime, bin, arenas_management. One latent hermeticity bug surfaced: prof_sys.h declares `void bt_init(prof_bt_t *bt, void **vec);` but didn't include prof.h where prof_bt_t is defined. Added the include. Step 6 (Option B) of the cyclical-dep cleanup, batch 4 of N. --- include/jemalloc/internal/prof_sys.h | 1 + src/arenas_management.c | 8 +++++++- src/bin.c | 3 ++- src/decay.c | 1 - src/ehooks.c | 8 +++++++- src/extent_dss.c | 7 ++++++- src/jemalloc_fork.c | 9 ++++++++- src/large.c | 8 +++++++- src/mutex.c | 2 +- src/nstime.c | 4 +--- src/pa.c | 5 +++-- src/pa_extra.c | 3 ++- src/prof_stack_range.c | 1 - src/rtree.c | 2 +- src/san.c | 2 +- src/thread_event_registry.c | 11 +++++++---- 16 files changed, 54 insertions(+), 21 deletions(-) diff --git a/include/jemalloc/internal/prof_sys.h b/include/jemalloc/internal/prof_sys.h index 0745b991..e671a47c 100644 --- a/include/jemalloc/internal/prof_sys.h +++ b/include/jemalloc/internal/prof_sys.h @@ -4,6 +4,7 @@ #include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/base.h" #include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/prof.h" extern malloc_mutex_t prof_dump_filename_mtx; extern base_t *prof_base; diff --git a/src/arenas_management.c b/src/arenas_management.c index 261557b6..e4d2aa75 100644 --- a/src/arenas_management.c +++ b/src/arenas_management.c @@ -1,11 +1,17 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" #include "jemalloc/internal/arenas_management.h" +#include "jemalloc/internal/background_thread.h" +#include "jemalloc/internal/background_thread_inlines.h" #include "jemalloc/internal/jemalloc_init.h" +#include "jemalloc/internal/jemalloc_internal_inlines_a.h" +#include "jemalloc/internal/jemalloc_internal_inlines_b.h" +#include "jemalloc/internal/jemalloc_internal_inlines_c.h" #include "jemalloc/internal/malloc_io.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/sz.h" +#include "jemalloc/internal/tcache.h" JEMALLOC_ALIGNED(CACHELINE) atomic_p_t arenas[MALLOCX_ARENA_LIMIT]; diff --git a/src/bin.c b/src/bin.c index 30a78aba..ac17f16a 100644 --- a/src/bin.c +++ b/src/bin.c @@ -1,6 +1,7 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" +#include "jemalloc/internal/arena_inlines_b.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/bin.h" #include "jemalloc/internal/sc.h" diff --git a/src/decay.c b/src/decay.c index 7bbce2a6..1ed23bcb 100644 --- a/src/decay.c +++ b/src/decay.c @@ -1,5 +1,4 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/decay.h" diff --git a/src/ehooks.c b/src/ehooks.c index d7abb960..bd9a8ac6 100644 --- a/src/ehooks.c +++ b/src/ehooks.c @@ -1,8 +1,14 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" +#include "jemalloc/internal/base.h" +#include "jemalloc/internal/edata.h" #include "jemalloc/internal/ehooks.h" +#include "jemalloc/internal/emap.h" +#include "jemalloc/internal/extent.h" +#include "jemalloc/internal/extent_dss.h" #include "jemalloc/internal/extent_mmap.h" +#include "jemalloc/internal/jemalloc_internal_inlines_a.h" void ehooks_init(ehooks_t *ehooks, extent_hooks_t *extent_hooks, unsigned ind) { diff --git a/src/extent_dss.c b/src/extent_dss.c index 8fac71a7..16faa0a2 100644 --- a/src/extent_dss.c +++ b/src/extent_dss.c @@ -1,9 +1,14 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" +#include "jemalloc/internal/arena_inlines_a.h" #include "jemalloc/internal/assert.h" +#include "jemalloc/internal/edata_cache.h" +#include "jemalloc/internal/extent.h" #include "jemalloc/internal/extent_dss.h" +#include "jemalloc/internal/jemalloc_internal_inlines_a.h" #include "jemalloc/internal/spin.h" +#include "jemalloc/internal/tsd.h" /******************************************************************************/ /* Data. */ diff --git a/src/jemalloc_fork.c b/src/jemalloc_fork.c index 9bab77e8..3fc89c68 100644 --- a/src/jemalloc_fork.c +++ b/src/jemalloc_fork.c @@ -1,10 +1,17 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" #include "jemalloc/internal/arenas_management.h" +#include "jemalloc/internal/background_thread.h" #include "jemalloc/internal/ctl.h" #include "jemalloc/internal/jemalloc_fork.h" #include "jemalloc/internal/jemalloc_init.h" +#include "jemalloc/internal/jemalloc_internal_inlines_a.h" +#include "jemalloc/internal/jemalloc_internal_inlines_b.h" +#include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/prof.h" +#include "jemalloc/internal/tcache.h" +#include "jemalloc/internal/tsd.h" /******************************************************************************/ /* diff --git a/src/large.c b/src/large.c index 610c9b6c..197cb0ba 100644 --- a/src/large.c +++ b/src/large.c @@ -1,10 +1,16 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/arena.h" +#include "jemalloc/internal/arena_inlines_b.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/emap.h" +#include "jemalloc/internal/extent.h" #include "jemalloc/internal/extent_mmap.h" +#include "jemalloc/internal/jemalloc_internal_inlines_c.h" +#include "jemalloc/internal/large.h" #include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/prof.h" +#include "jemalloc/internal/prof_inlines.h" #include "jemalloc/internal/prof_recent.h" #include "jemalloc/internal/util.h" diff --git a/src/mutex.c b/src/mutex.c index aa2ab665..04a14a24 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -1,8 +1,8 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/malloc_io.h" +#include "jemalloc/internal/mutex.h" #include "jemalloc/internal/spin.h" #if defined(_WIN32) && !defined(_CRT_SPINCOUNT) diff --git a/src/nstime.c b/src/nstime.c index 0dfbeda1..5517877d 100644 --- a/src/nstime.c +++ b/src/nstime.c @@ -1,9 +1,7 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" - -#include "jemalloc/internal/nstime.h" #include "jemalloc/internal/assert.h" +#include "jemalloc/internal/nstime.h" #define BILLION UINT64_C(1000000000) #define MILLION UINT64_C(1000000) diff --git a/src/pa.c b/src/pa.c index f14fda81..2a560ed9 100644 --- a/src/pa.c +++ b/src/pa.c @@ -1,8 +1,9 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" -#include "jemalloc/internal/san.h" +#include "jemalloc/internal/background_thread.h" #include "jemalloc/internal/hpa.h" +#include "jemalloc/internal/pa.h" +#include "jemalloc/internal/san.h" static void pa_nactive_add(pa_shard_t *shard, size_t add_pages) { diff --git a/src/pa_extra.c b/src/pa_extra.c index 17b4449a..24ff2e6d 100644 --- a/src/pa_extra.c +++ b/src/pa_extra.c @@ -1,5 +1,6 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" + +#include "jemalloc/internal/pa.h" /* * This file is logically part of the PA module. While pa.c contains the core diff --git a/src/prof_stack_range.c b/src/prof_stack_range.c index 8ebcab8e..ef5e8062 100644 --- a/src/prof_stack_range.c +++ b/src/prof_stack_range.c @@ -1,5 +1,4 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/malloc_io.h" #include "jemalloc/internal/prof_sys.h" diff --git a/src/rtree.c b/src/rtree.c index ac27f829..a63f2b01 100644 --- a/src/rtree.c +++ b/src/rtree.c @@ -1,8 +1,8 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/rtree.h" /* * Only the most significant bits of keys passed to rtree_{read,write}() are diff --git a/src/san.c b/src/san.c index 5448c67f..99a3d783 100644 --- a/src/san.c +++ b/src/san.c @@ -1,8 +1,8 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/assert.h" #include "jemalloc/internal/ehooks.h" +#include "jemalloc/internal/emap.h" #include "jemalloc/internal/san.h" #include "jemalloc/internal/tsd.h" diff --git a/src/thread_event_registry.c b/src/thread_event_registry.c index 1db8fa72..a25050e8 100644 --- a/src/thread_event_registry.c +++ b/src/thread_event_registry.c @@ -1,12 +1,15 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" -#include "jemalloc/internal/thread_event.h" -#include "jemalloc/internal/thread_event_registry.h" -#include "jemalloc/internal/tcache.h" +#include "jemalloc/internal/jemalloc_internal_inlines_a.h" +#include "jemalloc/internal/mutex.h" #include "jemalloc/internal/peak_event.h" #include "jemalloc/internal/prof.h" #include "jemalloc/internal/stats.h" +#include "jemalloc/internal/tcache.h" +#include "jemalloc/internal/thread_event.h" +#include "jemalloc/internal/thread_event_registry.h" +#include "jemalloc/internal/tsd.h" +#include "jemalloc/internal/witness.h" static malloc_mutex_t uevents_mu;