• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef JEMALLOC_INTERNAL_INCLUDES_H
2 #define JEMALLOC_INTERNAL_INCLUDES_H
3 
4 /*
5  * jemalloc can conceptually be broken into components (arena, tcache, etc.),
6  * but there are circular dependencies that cannot be broken without
7  * substantial performance degradation.
8  *
9  * Historically, we dealt with this by each header into four sections (types,
10  * structs, externs, and inlines), and included each header file multiple times
11  * in this file, picking out the portion we want on each pass using the
12  * following #defines:
13  *   JEMALLOC_H_TYPES   : Preprocessor-defined constants and psuedo-opaque data
14  *                        types.
15  *   JEMALLOC_H_STRUCTS : Data structures.
16  *   JEMALLOC_H_EXTERNS : Extern data declarations and function prototypes.
17  *   JEMALLOC_H_INLINES : Inline functions.
18  *
19  * We're moving toward a world in which the dependencies are explicit; each file
20  * will #include the headers it depends on (rather than relying on them being
21  * implicitly available via this file including every header file in the
22  * project).
23  *
24  * We're now in an intermediate state: we've broken up the header files to avoid
25  * having to include each one multiple times, but have not yet moved the
26  * dependency information into the header files (i.e. we still rely on the
27  * ordering in this file to ensure all a header's dependencies are available in
28  * its translation unit).  Each component is now broken up into multiple header
29  * files, corresponding to the sections above (e.g. instead of "foo.h", we now
30  * have "foo_types.h", "foo_structs.h", "foo_externs.h", "foo_inlines.h").
31  *
32  * Those files which have been converted to explicitly include their
33  * inter-component dependencies are now in the initial HERMETIC HEADERS
34  * section.  All headers may still rely on jemalloc_preamble.h (which, by fiat,
35  * must be included first in every translation unit) for system headers and
36  * global jemalloc definitions, however.
37  */
38 
39 /******************************************************************************/
40 /* TYPES */
41 /******************************************************************************/
42 
43 #include "jemalloc/internal/extent_types.h"
44 #include "jemalloc/internal/base_types.h"
45 #include "jemalloc/internal/arena_types.h"
46 #include "jemalloc/internal/tcache_types.h"
47 #include "jemalloc/internal/prof_types.h"
48 
49 /******************************************************************************/
50 /* STRUCTS */
51 /******************************************************************************/
52 
53 #include "jemalloc/internal/arena_structs_a.h"
54 #include "jemalloc/internal/extent_structs.h"
55 #include "jemalloc/internal/base_structs.h"
56 #include "jemalloc/internal/prof_structs.h"
57 #include "jemalloc/internal/arena_structs_b.h"
58 #include "jemalloc/internal/tcache_structs.h"
59 #include "jemalloc/internal/background_thread_structs.h"
60 
61 /******************************************************************************/
62 /* EXTERNS */
63 /******************************************************************************/
64 
65 #include "jemalloc/internal/jemalloc_internal_externs.h"
66 #include "jemalloc/internal/extent_externs.h"
67 #include "jemalloc/internal/base_externs.h"
68 #include "jemalloc/internal/arena_externs.h"
69 #include "jemalloc/internal/large_externs.h"
70 #include "jemalloc/internal/tcache_externs.h"
71 #include "jemalloc/internal/prof_externs.h"
72 #include "jemalloc/internal/background_thread_externs.h"
73 
74 /******************************************************************************/
75 /* INLINES */
76 /******************************************************************************/
77 
78 #include "jemalloc/internal/jemalloc_internal_inlines_a.h"
79 #include "jemalloc/internal/base_inlines.h"
80 /*
81  * Include portions of arena code interleaved with tcache code in order to
82  * resolve circular dependencies.
83  */
84 #include "jemalloc/internal/prof_inlines_a.h"
85 #include "jemalloc/internal/arena_inlines_a.h"
86 #include "jemalloc/internal/extent_inlines.h"
87 #include "jemalloc/internal/jemalloc_internal_inlines_b.h"
88 #include "jemalloc/internal/tcache_inlines.h"
89 #include "jemalloc/internal/arena_inlines_b.h"
90 #include "jemalloc/internal/jemalloc_internal_inlines_c.h"
91 #include "jemalloc/internal/prof_inlines_b.h"
92 #include "jemalloc/internal/background_thread_inlines.h"
93 
94 #endif /* JEMALLOC_INTERNAL_INCLUDES_H */
95