From 26cd9389d3839ddceec4486594f67cecaf73a4c7 Mon Sep 17 00:00:00 2001 From: Slobodan Predolac Date: Wed, 27 May 2026 17:49:46 -0400 Subject: [PATCH] Break edata.h <-> prof_types.h #include coupling edata.h only uses prof_tctx_t and prof_recent_t as opaque pointer types (in two getters, two setters, and two struct fields), so forward declarations are sufficient. Drop the #include of prof_types.h and declare the two typedefs locally. --- include/jemalloc/internal/edata.h | 5 ++++- include/jemalloc/internal/prof_structs.h | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/jemalloc/internal/edata.h b/include/jemalloc/internal/edata.h index 217232f7..198d55e1 100644 --- a/include/jemalloc/internal/edata.h +++ b/include/jemalloc/internal/edata.h @@ -8,13 +8,16 @@ #include "jemalloc/internal/hpdata.h" #include "jemalloc/internal/nstime.h" #include "jemalloc/internal/ph.h" -#include "jemalloc/internal/prof_types.h" #include "jemalloc/internal/ql.h" #include "jemalloc/internal/sc.h" #include "jemalloc/internal/slab_data.h" #include "jemalloc/internal/sz.h" #include "jemalloc/internal/typed_list.h" +/* Opaque to edata; only stored as pointers in e_prof_info_t. */ +typedef struct prof_tctx_s prof_tctx_t; +typedef struct prof_recent_s prof_recent_t; + /* * sizeof(edata_t) is 128 bytes on 64-bit architectures. Ensure the alignment * to free up the low bits in the rtree leaf. diff --git a/include/jemalloc/internal/prof_structs.h b/include/jemalloc/internal/prof_structs.h index d38b15ea..d3a13718 100644 --- a/include/jemalloc/internal/prof_structs.h +++ b/include/jemalloc/internal/prof_structs.h @@ -3,7 +3,6 @@ #include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/ckh.h" -#include "jemalloc/internal/edata.h" #include "jemalloc/internal/mutex.h" #include "jemalloc/internal/prng.h" #include "jemalloc/internal/rb.h"