Lines Matching refs:tsd
50 static int n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, \
642 arenas_i_impl(tsd_t *tsd, size_t i, bool compat, bool init) { in arenas_i_impl() argument
655 (struct container_s *)base_alloc(tsd_tsdn(tsd), in arenas_i_impl()
663 ret = (ctl_arena_t *)base_alloc(tsd_tsdn(tsd), b0get(), in arenas_i_impl()
885 ctl_arena_init(tsd_t *tsd, extent_hooks_t *extent_hooks) { in ctl_arena_init() argument
898 if (arenas_i_impl(tsd, arena_ind, false, true) == NULL) { in ctl_arena_init()
903 if (arena_init(tsd_tsdn(tsd), arena_ind, extent_hooks) == NULL) { in ctl_arena_init()
999 ctl_init(tsd_t *tsd) { in ctl_init() argument
1001 tsdn_t *tsdn = tsd_tsdn(tsd); in ctl_init()
1035 if ((ctl_sarena = arenas_i_impl(tsd, MALLCTL_ARENAS_ALL, false, in ctl_init()
1042 if ((ctl_darena = arenas_i_impl(tsd, MALLCTL_ARENAS_DESTROYED, in ctl_init()
1056 if (arenas_i_impl(tsd, i, false, true) == NULL) { in ctl_init()
1173 ctl_byname(tsd_t *tsd, const char *name, void *oldp, size_t *oldlenp, in ctl_byname() argument
1181 if (!ctl_initialized && ctl_init(tsd)) { in ctl_byname()
1187 ret = ctl_lookup(tsd_tsdn(tsd), name, nodes, mib, &depth); in ctl_byname()
1194 ret = node->ctl(tsd, mib, depth, oldp, oldlenp, newp, newlen); in ctl_byname()
1205 ctl_nametomib(tsd_t *tsd, const char *name, size_t *mibp, size_t *miblenp) { in ctl_nametomib() argument
1208 if (!ctl_initialized && ctl_init(tsd)) { in ctl_nametomib()
1213 ret = ctl_lookup(tsd_tsdn(tsd), name, NULL, mibp, miblenp); in ctl_nametomib()
1219 ctl_bymib(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in ctl_bymib() argument
1225 if (!ctl_initialized && ctl_init(tsd)) { in ctl_bymib()
1247 node = inode->index(tsd_tsdn(tsd), mib, miblen, mib[i]); in ctl_bymib()
1257 ret = node->ctl(tsd, mib, miblen, oldp, oldlenp, newp, newlen); in ctl_bymib()
1356 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1365 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); \
1374 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); \
1381 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1389 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); \
1396 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); \
1402 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1407 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); \
1414 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); \
1424 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1443 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1459 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1468 oldval = (m(tsd)); \
1478 n##_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, \
1497 epoch_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in CTL_RO_NL_GEN()
1502 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in CTL_RO_NL_GEN()
1505 ctl_refresh(tsd_tsdn(tsd)); in CTL_RO_NL_GEN()
1511 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in CTL_RO_NL_GEN()
1516 background_thread_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in background_thread_ctl() argument
1524 background_thread_ctl_init(tsd_tsdn(tsd)); in background_thread_ctl()
1526 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in background_thread_ctl()
1527 malloc_mutex_lock(tsd_tsdn(tsd), &background_thread_lock); in background_thread_ctl()
1545 background_thread_enabled_set(tsd_tsdn(tsd), newval); in background_thread_ctl()
1554 if (background_threads_enable(tsd)) { in background_thread_ctl()
1559 if (background_threads_disable(tsd)) { in background_thread_ctl()
1567 malloc_mutex_unlock(tsd_tsdn(tsd), &background_thread_lock); in background_thread_ctl()
1568 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in background_thread_ctl()
1574 max_background_threads_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in max_background_threads_ctl() argument
1582 background_thread_ctl_init(tsd_tsdn(tsd)); in max_background_threads_ctl()
1584 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in max_background_threads_ctl()
1585 malloc_mutex_lock(tsd_tsdn(tsd), &background_thread_lock); in max_background_threads_ctl()
1615 background_thread_enabled_set(tsd_tsdn(tsd), false); in max_background_threads_ctl()
1616 if (background_threads_disable(tsd)) { in max_background_threads_ctl()
1621 background_thread_enabled_set(tsd_tsdn(tsd), true); in max_background_threads_ctl()
1622 if (background_threads_enable(tsd)) { in max_background_threads_ctl()
1632 malloc_mutex_unlock(tsd_tsdn(tsd), &background_thread_lock); in max_background_threads_ctl()
1633 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in max_background_threads_ctl()
1693 thread_arena_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in CTL_RO_CONFIG_GEN()
1699 oldarena = arena_choose(tsd, NULL); in CTL_RO_CONFIG_GEN()
1730 newarena = arena_get(tsd_tsdn(tsd), newind, true); in CTL_RO_CONFIG_GEN()
1736 arena_migrate(tsd, oldind, newind); in CTL_RO_CONFIG_GEN()
1737 if (tcache_available(tsd)) { in CTL_RO_CONFIG_GEN()
1738 tcache_arena_reassociate(tsd_tsdn(tsd), in CTL_RO_CONFIG_GEN()
1739 tsd_tcachep_get(tsd), newarena); in CTL_RO_CONFIG_GEN()
1758 thread_tcache_enabled_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in CTL_TSD_RO_NL_CGEN()
1763 oldval = tcache_enabled_get(tsd); in CTL_TSD_RO_NL_CGEN()
1769 tcache_enabled_set(tsd, *(bool *)newp); in CTL_TSD_RO_NL_CGEN()
1779 thread_tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in thread_tcache_flush_ctl() argument
1783 if (!tcache_available(tsd)) { in thread_tcache_flush_ctl()
1791 tcache_flush(tsd); in thread_tcache_flush_ctl()
1799 thread_prof_name_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in thread_prof_name_ctl() argument
1815 if ((ret = prof_thread_name_set(tsd, *(const char **)newp)) != in thread_prof_name_ctl()
1820 const char *oldname = prof_thread_name_get(tsd); in thread_prof_name_ctl()
1830 thread_prof_active_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in thread_prof_active_ctl() argument
1839 oldval = prof_thread_active_get(tsd); in thread_prof_active_ctl()
1845 if (prof_thread_active_set(tsd, *(bool *)newp)) { in thread_prof_active_ctl()
1860 tcache_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in tcache_create_ctl() argument
1866 if (tcaches_create(tsd, &tcache_ind)) { in tcache_create_ctl()
1878 tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in tcache_flush_ctl() argument
1890 tcaches_flush(tsd, tcache_ind); in tcache_flush_ctl()
1898 tcache_destroy_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in tcache_destroy_ctl() argument
1910 tcaches_destroy(tsd, tcache_ind); in tcache_destroy_ctl()
1920 arena_i_initialized_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_initialized_ctl() argument
1923 tsdn_t *tsdn = tsd_tsdn(tsd); in arena_i_initialized_ctl()
1989 arena_i_decay_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arena_i_decay_ctl() argument
1997 arena_i_decay(tsd_tsdn(tsd), arena_ind, false); in arena_i_decay_ctl()
2005 arena_i_purge_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arena_i_purge_ctl() argument
2013 arena_i_decay(tsd_tsdn(tsd), arena_ind, true); in arena_i_purge_ctl()
2021 arena_i_reset_destroy_helper(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_reset_destroy_helper() argument
2030 *arena = arena_get(tsd_tsdn(tsd), *arena_ind, false); in arena_i_reset_destroy_helper()
2042 arena_reset_prepare_background_thread(tsd_t *tsd, unsigned arena_ind) { in arena_reset_prepare_background_thread() argument
2045 malloc_mutex_lock(tsd_tsdn(tsd), &background_thread_lock); in arena_reset_prepare_background_thread()
2051 malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx); in arena_reset_prepare_background_thread()
2053 malloc_mutex_unlock(tsd_tsdn(tsd), &info->mtx); in arena_reset_prepare_background_thread()
2059 arena_reset_finish_background_thread(tsd_t *tsd, unsigned arena_ind) { in arena_reset_finish_background_thread() argument
2066 malloc_mutex_lock(tsd_tsdn(tsd), &info->mtx); in arena_reset_finish_background_thread()
2068 malloc_mutex_unlock(tsd_tsdn(tsd), &info->mtx); in arena_reset_finish_background_thread()
2070 malloc_mutex_unlock(tsd_tsdn(tsd), &background_thread_lock); in arena_reset_finish_background_thread()
2075 arena_i_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arena_i_reset_ctl() argument
2081 ret = arena_i_reset_destroy_helper(tsd, mib, miblen, oldp, oldlenp, in arena_i_reset_ctl()
2087 arena_reset_prepare_background_thread(tsd, arena_ind); in arena_i_reset_ctl()
2088 arena_reset(tsd, arena); in arena_i_reset_ctl()
2089 arena_reset_finish_background_thread(tsd, arena_ind); in arena_i_reset_ctl()
2095 arena_i_destroy_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arena_i_destroy_ctl() argument
2102 ret = arena_i_reset_destroy_helper(tsd, mib, miblen, oldp, oldlenp, in arena_i_destroy_ctl()
2114 arena_reset_prepare_background_thread(tsd, arena_ind); in arena_i_destroy_ctl()
2116 arena_reset(tsd, arena); in arena_i_destroy_ctl()
2117 arena_decay(tsd_tsdn(tsd), arena, false, true); in arena_i_destroy_ctl()
2120 ctl_arena_refresh(tsd_tsdn(tsd), arena, ctl_darena, arena_ind, true); in arena_i_destroy_ctl()
2122 arena_destroy(tsd, arena); in arena_i_destroy_ctl()
2128 arena_reset_finish_background_thread(tsd, arena_ind); in arena_i_destroy_ctl()
2136 arena_i_dss_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arena_i_dss_ctl() argument
2144 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_dss_ctl()
2178 arena_t *arena = arena_get(tsd_tsdn(tsd), arena_ind, false); in arena_i_dss_ctl()
2192 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_dss_ctl()
2197 arena_i_decay_ms_ctl_impl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_decay_ms_ctl_impl() argument
2204 arena = arena_get(tsd_tsdn(tsd), arena_ind, false); in arena_i_decay_ms_ctl_impl()
2220 if (dirty ? arena_dirty_decay_ms_set(tsd_tsdn(tsd), arena, in arena_i_decay_ms_ctl_impl()
2221 *(ssize_t *)newp) : arena_muzzy_decay_ms_set(tsd_tsdn(tsd), in arena_i_decay_ms_ctl_impl()
2234 arena_i_dirty_decay_ms_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_dirty_decay_ms_ctl() argument
2236 return arena_i_decay_ms_ctl_impl(tsd, mib, miblen, oldp, oldlenp, newp, in arena_i_dirty_decay_ms_ctl()
2241 arena_i_muzzy_decay_ms_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_muzzy_decay_ms_ctl() argument
2243 return arena_i_decay_ms_ctl_impl(tsd, mib, miblen, oldp, oldlenp, newp, in arena_i_muzzy_decay_ms_ctl()
2248 arena_i_extent_hooks_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_extent_hooks_ctl() argument
2254 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_extent_hooks_ctl()
2258 arena = arena_get(tsd_tsdn(tsd), arena_ind, false); in arena_i_extent_hooks_ctl()
2272 arena = arena_init(tsd_tsdn(tsd), arena_ind, in arena_i_extent_hooks_ctl()
2284 old_extent_hooks = extent_hooks_set(tsd, arena, in arena_i_extent_hooks_ctl()
2298 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_extent_hooks_ctl()
2303 arena_i_retain_grow_limit_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arena_i_retain_grow_limit_ctl() argument
2314 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_retain_grow_limit_ctl()
2317 arena_get(tsd_tsdn(tsd), arena_ind, false)) != NULL) { in arena_i_retain_grow_limit_ctl()
2322 bool err = arena_retain_grow_limit_get_set(tsd, arena, in arena_i_retain_grow_limit_ctl()
2334 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arena_i_retain_grow_limit_ctl()
2364 arenas_narenas_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arenas_narenas_ctl() argument
2369 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arenas_narenas_ctl()
2380 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arenas_narenas_ctl()
2385 arenas_decay_ms_ctl_impl(tsd_t *tsd, const size_t *mib, size_t miblen, in arenas_decay_ms_ctl_impl() argument
2412 arenas_dirty_decay_ms_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arenas_dirty_decay_ms_ctl() argument
2414 return arenas_decay_ms_ctl_impl(tsd, mib, miblen, oldp, oldlenp, newp, in arenas_dirty_decay_ms_ctl()
2419 arenas_muzzy_decay_ms_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in arenas_muzzy_decay_ms_ctl() argument
2421 return arenas_decay_ms_ctl_impl(tsd, mib, miblen, oldp, oldlenp, newp, in arenas_muzzy_decay_ms_ctl()
2454 arenas_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arenas_create_ctl() argument
2460 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arenas_create_ctl()
2464 if ((arena_ind = ctl_arena_init(tsd, extent_hooks)) == UINT_MAX) { in arenas_create_ctl()
2472 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arenas_create_ctl()
2477 arenas_lookup_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in arenas_lookup_ctl() argument
2487 malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx); in arenas_lookup_ctl()
2489 extent = iealloc(tsd_tsdn(tsd), ptr); in arenas_lookup_ctl()
2502 malloc_mutex_unlock(tsd_tsdn(tsd), &ctl_mtx); in arenas_lookup_ctl()
2509 prof_thread_active_init_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in prof_thread_active_init_ctl() argument
2523 oldval = prof_thread_active_init_set(tsd_tsdn(tsd), in prof_thread_active_init_ctl()
2526 oldval = prof_thread_active_init_get(tsd_tsdn(tsd)); in prof_thread_active_init_ctl()
2536 prof_active_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in prof_active_ctl() argument
2550 oldval = prof_active_set(tsd_tsdn(tsd), *(bool *)newp); in prof_active_ctl()
2552 oldval = prof_active_get(tsd_tsdn(tsd)); in prof_active_ctl()
2562 prof_dump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in prof_dump_ctl() argument
2574 if (prof_mdump(tsd, filename)) { in prof_dump_ctl()
2585 prof_gdump_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in prof_gdump_ctl() argument
2599 oldval = prof_gdump_set(tsd_tsdn(tsd), *(bool *)newp); in prof_gdump_ctl()
2601 oldval = prof_gdump_get(tsd_tsdn(tsd)); in prof_gdump_ctl()
2611 prof_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, in prof_reset_ctl() argument
2626 prof_reset(tsd, lg_sample); in prof_reset_ctl()
2768 stats_mutexes_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, in CTL_RO_NL_CGEN()
2774 tsdn_t *tsdn = tsd_tsdn(tsd); in CTL_RO_NL_CGEN()