From e709fae1d73b874796d7f629ef39a44e9b53fa87 Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Mon, 10 Apr 2017 19:04:40 -0700 Subject: [PATCH] Header refactoring: move atomic.h out of the catch-all --- include/jemalloc/internal/arena_structs_b.h | 1 + include/jemalloc/internal/atomic.h | 4 ++++ include/jemalloc/internal/extent_structs.h | 1 + include/jemalloc/internal/jemalloc_internal_externs.h | 2 ++ include/jemalloc/internal/jemalloc_internal_includes.h | 1 - include/jemalloc/internal/jemalloc_internal_inlines_a.h | 2 ++ include/jemalloc/internal/mutex_structs.h | 2 ++ include/jemalloc/internal/prng_inlines.h | 2 ++ include/jemalloc/internal/rtree_structs.h | 2 ++ include/jemalloc/internal/stats_structs.h | 2 ++ src/jemalloc.c | 2 ++ 11 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/jemalloc/internal/arena_structs_b.h b/include/jemalloc/internal/arena_structs_b.h index 935cd169..1f4fb6b1 100644 --- a/include/jemalloc/internal/arena_structs_b.h +++ b/include/jemalloc/internal/arena_structs_b.h @@ -1,6 +1,7 @@ #ifndef JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H #define JEMALLOC_INTERNAL_ARENA_STRUCTS_B_H +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/ql.h" /* diff --git a/include/jemalloc/internal/atomic.h b/include/jemalloc/internal/atomic.h index adadb1a3..1bfae7d7 100644 --- a/include/jemalloc/internal/atomic.h +++ b/include/jemalloc/internal/atomic.h @@ -3,6 +3,8 @@ #define ATOMIC_INLINE static inline +CPP_PROLOGUE + #if defined(JEMALLOC_GCC_ATOMIC_ATOMICS) # include "jemalloc/internal/atomic_gcc_atomic.h" #elif defined(JEMALLOC_GCC_SYNC_ATOMICS) @@ -74,4 +76,6 @@ JEMALLOC_GENERATE_INT_ATOMICS(uint64_t, u64, 3) #undef ATOMIC_INLINE +CPP_EPILOGUE + #endif /* JEMALLOC_INTERNAL_ATOMIC_H */ diff --git a/include/jemalloc/internal/extent_structs.h b/include/jemalloc/internal/extent_structs.h index 2f81fa1c..3d3d418b 100644 --- a/include/jemalloc/internal/extent_structs.h +++ b/include/jemalloc/internal/extent_structs.h @@ -1,6 +1,7 @@ #ifndef JEMALLOC_INTERNAL_EXTENT_STRUCTS_H #define JEMALLOC_INTERNAL_EXTENT_STRUCTS_H +#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/ph.h" #include "jemalloc/internal/ql.h" diff --git a/include/jemalloc/internal/jemalloc_internal_externs.h b/include/jemalloc/internal/jemalloc_internal_externs.h index 7ac39bea..56d39d48 100644 --- a/include/jemalloc/internal/jemalloc_internal_externs.h +++ b/include/jemalloc/internal/jemalloc_internal_externs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_EXTERNS_H #define JEMALLOC_INTERNAL_EXTERNS_H +#include "jemalloc/internal/atomic.h" + extern bool opt_abort; extern const char *opt_junk; extern bool opt_junk_alloc; diff --git a/include/jemalloc/internal/jemalloc_internal_includes.h b/include/jemalloc/internal/jemalloc_internal_includes.h index 45035137..53374f99 100644 --- a/include/jemalloc/internal/jemalloc_internal_includes.h +++ b/include/jemalloc/internal/jemalloc_internal_includes.h @@ -43,7 +43,6 @@ CPP_PROLOGUE /******************************************************************************/ #include "jemalloc/internal/assert.h" -#include "jemalloc/internal/atomic.h" #include "jemalloc/internal/bit_util.h" #include "jemalloc/internal/malloc_io.h" #include "jemalloc/internal/util.h" diff --git a/include/jemalloc/internal/jemalloc_internal_inlines_a.h b/include/jemalloc/internal/jemalloc_internal_inlines_a.h index 256329a0..822b4d75 100644 --- a/include/jemalloc/internal/jemalloc_internal_inlines_a.h +++ b/include/jemalloc/internal/jemalloc_internal_inlines_a.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_INLINES_A_H #define JEMALLOC_INTERNAL_INLINES_A_H +#include "jemalloc/internal/atomic.h" + #ifndef JEMALLOC_ENABLE_INLINE pszind_t psz2ind(size_t psz); size_t pind2sz_compute(pszind_t pind); diff --git a/include/jemalloc/internal/mutex_structs.h b/include/jemalloc/internal/mutex_structs.h index ff090b22..7b7085d4 100644 --- a/include/jemalloc/internal/mutex_structs.h +++ b/include/jemalloc/internal/mutex_structs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_MUTEX_STRUCTS_H #define JEMALLOC_INTERNAL_MUTEX_STRUCTS_H +#include "jemalloc/internal/atomic.h" + struct mutex_prof_data_s { /* * Counters touched on the slow path, i.e. when there is lock diff --git a/include/jemalloc/internal/prng_inlines.h b/include/jemalloc/internal/prng_inlines.h index 3f06ccd4..7026d52a 100644 --- a/include/jemalloc/internal/prng_inlines.h +++ b/include/jemalloc/internal/prng_inlines.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_PRNG_INLINES_H #define JEMALLOC_INTERNAL_PRNG_INLINES_H +#include "jemalloc/internal/atomic.h" + #ifndef JEMALLOC_ENABLE_INLINE uint32_t prng_state_next_u32(uint32_t state); uint64_t prng_state_next_u64(uint64_t state); diff --git a/include/jemalloc/internal/rtree_structs.h b/include/jemalloc/internal/rtree_structs.h index 123248ae..175a013c 100644 --- a/include/jemalloc/internal/rtree_structs.h +++ b/include/jemalloc/internal/rtree_structs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_RTREE_STRUCTS_H #define JEMALLOC_INTERNAL_RTREE_STRUCTS_H +#include "jemalloc/internal/atomic.h" + struct rtree_node_elm_s { atomic_p_t child; /* (rtree_{node,leaf}_elm_t *) */ }; diff --git a/include/jemalloc/internal/stats_structs.h b/include/jemalloc/internal/stats_structs.h index 75a4a783..dc994b52 100644 --- a/include/jemalloc/internal/stats_structs.h +++ b/include/jemalloc/internal/stats_structs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_STATS_STRUCTS_H #define JEMALLOC_INTERNAL_STATS_STRUCTS_H +#include "jemalloc/internal/atomic.h" + #ifdef JEMALLOC_ATOMIC_U64 typedef atomic_u64_t arena_stats_u64_t; #else diff --git a/src/jemalloc.c b/src/jemalloc.c index 27f9711c..77ee857c 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -2,6 +2,8 @@ #include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/jemalloc_internal_includes.h" +#include "jemalloc/internal/atomic.h" + /******************************************************************************/ /* Data. */