From 89440d0fd3cbe9a8d4a943d5373ecf022e1487f3 Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Wed, 27 May 2026 18:50:57 -0400 Subject: [PATCH] Drop umbrella include from 9 medium .c files (batch 2) Converted: hpa_utils, ecache, extent_mmap, util, safety_check, prof_stats, peak_event, inspect, log. (src/div.c was already minimal; skipped.) One latent hermeticity bug surfaced: peak_event.h declared `extern te_base_cb_t peak_te_handler;` but didn't include thread_event_registry.h where te_base_cb_t is typedef'd. Added the include to peak_event.h. peak_event.c also needs thread_event.h directly for TE_MIN_START_WAIT. Step 6 (Option B) of the cyclical-dep cleanup, batch 2 of N. --- include/jemalloc/internal/peak_event.h | 1 + src/ecache.c | 6 ++++-- src/extent_mmap.c | 2 +- src/hpa_utils.c | 2 +- src/inspect.c | 7 ++++++- src/log.c | 1 - src/peak_event.c | 6 +++--- src/prof_stats.c | 4 +++- src/safety_check.c | 4 +++- src/util.c | 2 +- 10 files changed, 23 insertions(+), 12 deletions(-) diff --git a/include/jemalloc/internal/peak_event.h b/include/jemalloc/internal/peak_event.h index 0d1f1627..67e7a71b 100644 --- a/include/jemalloc/internal/peak_event.h +++ b/include/jemalloc/internal/peak_event.h @@ -2,6 +2,7 @@ #define JEMALLOC_INTERNAL_PEAK_EVENT_H #include "jemalloc/internal/jemalloc_preamble.h" +#include "jemalloc/internal/thread_event_registry.h" #include "jemalloc/internal/tsd_types.h" /* diff --git a/src/ecache.c b/src/ecache.c index 20fcee9e..e6620a8a 100644 --- a/src/ecache.c +++ b/src/ecache.c @@ -1,7 +1,9 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" -#include "jemalloc/internal/san.h" +#include "jemalloc/internal/ecache.h" +#include "jemalloc/internal/eset.h" +#include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/witness.h" bool ecache_init(tsdn_t *tsdn, ecache_t *ecache, extent_state_t state, unsigned ind, diff --git a/src/extent_mmap.c b/src/extent_mmap.c index d39bddc6..10574618 100644 --- a/src/extent_mmap.c +++ b/src/extent_mmap.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/extent_mmap.h" +#include "jemalloc/internal/pages.h" /******************************************************************************/ /* Data. */ diff --git a/src/hpa_utils.c b/src/hpa_utils.c index 59bb0d1f..02817d83 100644 --- a/src/hpa_utils.c +++ b/src/hpa_utils.c @@ -1,7 +1,7 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/hpa_utils.h" +#include "jemalloc/internal/hpdata.h" void hpa_purge_batch(hpa_hooks_t *hooks, hpa_purge_item_t *batch, size_t batch_sz) { diff --git a/src/inspect.c b/src/inspect.c index 1c0de129..b2a961b2 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -1,5 +1,10 @@ #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/bin_info.h" +#include "jemalloc/internal/edata.h" +#include "jemalloc/internal/emap.h" #include "jemalloc/internal/inspect.h" void diff --git a/src/log.c b/src/log.c index 9b1c6261..63054d83 100644 --- a/src/log.c +++ b/src/log.c @@ -1,5 +1,4 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" #include "jemalloc/internal/log.h" diff --git a/src/peak_event.c b/src/peak_event.c index 39f90b70..f42cfc47 100644 --- a/src/peak_event.c +++ b/src/peak_event.c @@ -1,10 +1,10 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" - -#include "jemalloc/internal/peak_event.h" #include "jemalloc/internal/peak.h" +#include "jemalloc/internal/peak_event.h" +#include "jemalloc/internal/thread_event.h" #include "jemalloc/internal/thread_event_registry.h" +#include "jemalloc/internal/tsd.h" /* Update the peak with current tsd state. */ void diff --git a/src/prof_stats.c b/src/prof_stats.c index db248be7..81d5e6f6 100644 --- a/src/prof_stats.c +++ b/src/prof_stats.c @@ -1,7 +1,9 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/mutex.h" +#include "jemalloc/internal/prof.h" #include "jemalloc/internal/prof_stats.h" +#include "jemalloc/internal/tsd.h" bool opt_prof_stats = false; malloc_mutex_t prof_stats_mtx; diff --git a/src/safety_check.c b/src/safety_check.c index d052718d..f11a263b 100644 --- a/src/safety_check.c +++ b/src/safety_check.c @@ -1,5 +1,7 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" + +#include "jemalloc/internal/malloc_io.h" +#include "jemalloc/internal/safety_check.h" static safety_check_abort_hook_t safety_check_abort; diff --git a/src/util.c b/src/util.c index 1bcf4fee..a23a5c8c 100644 --- a/src/util.c +++ b/src/util.c @@ -1,6 +1,6 @@ #include "jemalloc/internal/jemalloc_preamble.h" -#include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/malloc_io.h" #include "jemalloc/internal/util.h" /* Reads the next size pair in a multi-sized option. */