1 /******************************************************************************/
2 #ifdef JEMALLOC_H_TYPES
4 typedef struct ctl_node_s ctl_node_t
;
5 typedef struct ctl_named_node_s ctl_named_node_t
;
6 typedef struct ctl_indexed_node_s ctl_indexed_node_t
;
7 typedef struct ctl_arena_stats_s ctl_arena_stats_t
;
8 typedef struct ctl_stats_s ctl_stats_t
;
10 #endif /* JEMALLOC_H_TYPES */
11 /******************************************************************************/
12 #ifdef JEMALLOC_H_STRUCTS
18 struct ctl_named_node_s
{
19 struct ctl_node_s node
;
21 /* If (nchildren == 0), this is a terminal node. */
23 const ctl_node_t
*children
;
24 int (*ctl
)(const size_t *, size_t, void *, size_t *,
28 struct ctl_indexed_node_s
{
29 struct ctl_node_s node
;
30 const ctl_named_node_t
*(*index
)(const size_t *, size_t, size_t);
33 struct ctl_arena_stats_s
{
40 /* Aggregate stats for small size classes, based on bin stats. */
41 size_t allocated_small
;
42 uint64_t nmalloc_small
;
43 uint64_t ndalloc_small
;
44 uint64_t nrequests_small
;
46 malloc_bin_stats_t bstats
[NBINS
];
47 malloc_large_stats_t
*lstats
; /* nlclasses elements. */
55 size_t current
; /* stats_chunks.curchunks */
56 uint64_t total
; /* stats_chunks.nchunks */
57 size_t high
; /* stats_chunks.highchunks */
60 size_t allocated
; /* huge_allocated */
61 uint64_t nmalloc
; /* huge_nmalloc */
62 uint64_t ndalloc
; /* huge_ndalloc */
64 ctl_arena_stats_t
*arenas
; /* (narenas + 1) elements. */
67 #endif /* JEMALLOC_H_STRUCTS */
68 /******************************************************************************/
69 #ifdef JEMALLOC_H_EXTERNS
71 int ctl_byname(const char *name
, void *oldp
, size_t *oldlenp
, void *newp
,
73 int ctl_nametomib(const char *name
, size_t *mibp
, size_t *miblenp
);
75 int ctl_bymib(const size_t *mib
, size_t miblen
, void *oldp
, size_t *oldlenp
,
76 void *newp
, size_t newlen
);
79 #define xmallctl(name, oldp, oldlenp, newp, newlen) do { \
80 if (je_mallctl(name, oldp, oldlenp, newp, newlen) \
83 "<jemalloc>: Failure in xmallctl(\"%s\", ...)\n", \
89 #define xmallctlnametomib(name, mibp, miblenp) do { \
90 if (je_mallctlnametomib(name, mibp, miblenp) != 0) { \
91 malloc_printf("<jemalloc>: Failure in " \
92 "xmallctlnametomib(\"%s\", ...)\n", name); \
97 #define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do { \
98 if (je_mallctlbymib(mib, miblen, oldp, oldlenp, newp, \
101 "<jemalloc>: Failure in xmallctlbymib()\n"); \
106 #endif /* JEMALLOC_H_EXTERNS */
107 /******************************************************************************/
108 #ifdef JEMALLOC_H_INLINES
110 #endif /* JEMALLOC_H_INLINES */
111 /******************************************************************************/