2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_CTL_EXTERNS_H
|
|
|
|
#define JEMALLOC_INTERNAL_CTL_EXTERNS_H
|
|
|
|
|
2017-03-11 04:14:05 +08:00
|
|
|
/* Maximum ctl tree depth. */
|
|
|
|
#define CTL_MAX_DEPTH 7
|
|
|
|
|
2017-03-14 08:29:03 +08:00
|
|
|
#define NUM_GLOBAL_PROF_MUTEXES 3
|
2017-03-16 05:00:57 +08:00
|
|
|
#define NUM_ARENA_PROF_MUTEXES 8
|
2017-03-14 08:29:03 +08:00
|
|
|
#define NUM_MUTEX_PROF_COUNTERS 7
|
2017-03-12 12:28:31 +08:00
|
|
|
|
2017-03-14 08:29:03 +08:00
|
|
|
extern const char *arena_mutex_names[NUM_ARENA_PROF_MUTEXES];
|
|
|
|
extern const char *global_mutex_names[NUM_GLOBAL_PROF_MUTEXES];
|
|
|
|
extern const char *mutex_counter_names[NUM_MUTEX_PROF_COUNTERS];
|
2017-03-11 04:14:05 +08:00
|
|
|
|
2017-01-11 10:06:31 +08:00
|
|
|
int ctl_byname(tsd_t *tsd, const char *name, void *oldp, size_t *oldlenp,
|
|
|
|
void *newp, size_t newlen);
|
|
|
|
int ctl_nametomib(tsdn_t *tsdn, const char *name, size_t *mibp,
|
|
|
|
size_t *miblenp);
|
|
|
|
|
|
|
|
int ctl_bymib(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
|
|
|
|
size_t *oldlenp, void *newp, size_t newlen);
|
|
|
|
bool ctl_boot(void);
|
|
|
|
void ctl_prefork(tsdn_t *tsdn);
|
|
|
|
void ctl_postfork_parent(tsdn_t *tsdn);
|
|
|
|
void ctl_postfork_child(tsdn_t *tsdn);
|
|
|
|
|
2017-01-20 13:41:41 +08:00
|
|
|
#define xmallctl(name, oldp, oldlenp, newp, newlen) do { \
|
2017-01-11 10:06:31 +08:00
|
|
|
if (je_mallctl(name, oldp, oldlenp, newp, newlen) \
|
|
|
|
!= 0) { \
|
|
|
|
malloc_printf( \
|
|
|
|
"<jemalloc>: Failure in xmallctl(\"%s\", ...)\n", \
|
|
|
|
name); \
|
|
|
|
abort(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2017-01-20 13:41:41 +08:00
|
|
|
#define xmallctlnametomib(name, mibp, miblenp) do { \
|
2017-01-11 10:06:31 +08:00
|
|
|
if (je_mallctlnametomib(name, mibp, miblenp) != 0) { \
|
|
|
|
malloc_printf("<jemalloc>: Failure in " \
|
|
|
|
"xmallctlnametomib(\"%s\", ...)\n", name); \
|
|
|
|
abort(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2017-01-20 13:41:41 +08:00
|
|
|
#define xmallctlbymib(mib, miblen, oldp, oldlenp, newp, newlen) do { \
|
2017-01-11 10:06:31 +08:00
|
|
|
if (je_mallctlbymib(mib, miblen, oldp, oldlenp, newp, \
|
|
|
|
newlen) != 0) { \
|
|
|
|
malloc_write( \
|
|
|
|
"<jemalloc>: Failure in xmallctlbymib()\n"); \
|
|
|
|
abort(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_INTERNAL_CTL_EXTERNS_H */
|