2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_CTL_EXTERNS_H
|
|
|
|
#define JEMALLOC_INTERNAL_CTL_EXTERNS_H
|
|
|
|
|
2017-04-12 04:06:31 +08:00
|
|
|
#include "jemalloc/internal/malloc_io.h"
|
|
|
|
|
2017-03-11 04:14:05 +08:00
|
|
|
/* Maximum ctl tree depth. */
|
|
|
|
#define CTL_MAX_DEPTH 7
|
|
|
|
|
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 */
|