| 3051 | } |
| 3052 | |
| 3053 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW |
| 3054 | je_mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, |
| 3055 | size_t newlen) { |
| 3056 | int ret; |
| 3057 | tsd_t *tsd; |
| 3058 | |
| 3059 | LOG("core.mallctl.entry", "name: %s", name); |
| 3060 | |
| 3061 | if (unlikely(malloc_init())) { |
| 3062 | LOG("core.mallctl.exit", "result: %d", EAGAIN); |
| 3063 | return EAGAIN; |
| 3064 | } |
| 3065 | |
| 3066 | tsd = tsd_fetch(); |
| 3067 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 3068 | ret = ctl_byname(tsd, name, oldp, oldlenp, newp, newlen); |
| 3069 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 3070 | |
| 3071 | LOG("core.mallctl.exit", "result: %d", ret); |
| 3072 | return ret; |
| 3073 | } |
| 3074 | |
| 3075 | JEMALLOC_EXPORT int JEMALLOC_NOTHROW |
| 3076 | je_mallctlnametomib(const char *name, size_t *mibp, size_t *miblenp) { |