From 63a5cd4cc2a4812adc7f3a8bd3ea0633115b151e Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Mon, 10 Apr 2017 17:03:25 -0700 Subject: [PATCH] Header refactoring: break out rb.h dependencies --- include/jemalloc/internal/jemalloc_internal.h.in | 4 ---- include/jemalloc/internal/prof_structs.h | 2 ++ include/jemalloc/internal/rb.h | 4 ++++ test/unit/rb.c | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in index 7756b8f0..532af2b8 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -180,10 +180,6 @@ static const bool have_percpu_arena = #include #endif -#ifndef __PGI -#define RB_COMPACT -#endif -#include "jemalloc/internal/rb.h" #include "jemalloc/internal/qr.h" #include "jemalloc/internal/ql.h" diff --git a/include/jemalloc/internal/prof_structs.h b/include/jemalloc/internal/prof_structs.h index fba8c295..e1936769 100644 --- a/include/jemalloc/internal/prof_structs.h +++ b/include/jemalloc/internal/prof_structs.h @@ -1,6 +1,8 @@ #ifndef JEMALLOC_INTERNAL_PROF_STRUCTS_H #define JEMALLOC_INTERNAL_PROF_STRUCTS_H +#include "jemalloc/internal/rb.h" + struct prof_bt_s { /* Backtrace, stored as len program counters. */ void **vec; diff --git a/include/jemalloc/internal/rb.h b/include/jemalloc/internal/rb.h index aa76061e..47fa5ca9 100644 --- a/include/jemalloc/internal/rb.h +++ b/include/jemalloc/internal/rb.h @@ -22,6 +22,10 @@ #ifndef RB_H_ #define RB_H_ +#ifndef __PGI +#define RB_COMPACT +#endif + #ifdef RB_COMPACT /* Node structure. */ #define rb_node(a_type) \ diff --git a/test/unit/rb.c b/test/unit/rb.c index 0bcc3c31..65c04920 100644 --- a/test/unit/rb.c +++ b/test/unit/rb.c @@ -1,5 +1,7 @@ #include "test/jemalloc_test.h" +#include "jemalloc/internal/rb.h" + #define rbtn_black_height(a_type, a_field, a_rbt, r_height) do { \ a_type *rbp_bh_t; \ for (rbp_bh_t = (a_rbt)->rbt_root, (r_height) = 0; rbp_bh_t != \