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 pseudo-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/arena_types.h" |
44 | #include "jemalloc/internal/tcache_types.h" |
45 | #include "jemalloc/internal/prof_types.h" |
46 | |
47 | /******************************************************************************/ |
48 | /* STRUCTS */ |
49 | /******************************************************************************/ |
50 | |
51 | #include "jemalloc/internal/prof_structs.h" |
52 | #include "jemalloc/internal/arena_structs.h" |
53 | #include "jemalloc/internal/tcache_structs.h" |
54 | #include "jemalloc/internal/background_thread_structs.h" |
55 | |
56 | /******************************************************************************/ |
57 | /* EXTERNS */ |
58 | /******************************************************************************/ |
59 | |
60 | #include "jemalloc/internal/jemalloc_internal_externs.h" |
61 | #include "jemalloc/internal/arena_externs.h" |
62 | #include "jemalloc/internal/large_externs.h" |
63 | #include "jemalloc/internal/tcache_externs.h" |
64 | #include "jemalloc/internal/prof_externs.h" |
65 | #include "jemalloc/internal/background_thread_externs.h" |
66 | |
67 | /******************************************************************************/ |
68 | /* INLINES */ |
69 | /******************************************************************************/ |
70 | |
71 | #include "jemalloc/internal/jemalloc_internal_inlines_a.h" |
72 | /* |
73 | * Include portions of arena code interleaved with tcache code in order to |
74 | * resolve circular dependencies. |
75 | */ |
76 | #include "jemalloc/internal/arena_inlines_a.h" |
77 | #include "jemalloc/internal/jemalloc_internal_inlines_b.h" |
78 | #include "jemalloc/internal/tcache_inlines.h" |
79 | #include "jemalloc/internal/arena_inlines_b.h" |
80 | #include "jemalloc/internal/jemalloc_internal_inlines_c.h" |
81 | #include "jemalloc/internal/prof_inlines.h" |
82 | #include "jemalloc/internal/background_thread_inlines.h" |
83 | |
84 | #endif /* JEMALLOC_INTERNAL_INCLUDES_H */ |
85 | |