Lines Matching refs:tsd
55 tsd_slow_update(tsd_t *tsd) { in tsd_slow_update() argument
56 if (tsd_nominal(tsd)) { in tsd_slow_update()
57 if (malloc_slow || !tsd_tcache_enabled_get(tsd) || in tsd_slow_update()
58 tsd_reentrancy_level_get(tsd) > 0) { in tsd_slow_update()
59 tsd->state = tsd_state_nominal_slow; in tsd_slow_update()
61 tsd->state = tsd_state_nominal; in tsd_slow_update()
67 tsd_data_init(tsd_t *tsd) { in tsd_data_init() argument
72 rtree_ctx_data_init(tsd_rtree_ctxp_get_unsafe(tsd)); in tsd_data_init()
81 *tsd_offset_statep_get(tsd) = config_debug ? 0 : in tsd_data_init()
82 (uint64_t)(uintptr_t)tsd; in tsd_data_init()
84 return tsd_tcache_enabled_data_init(tsd); in tsd_data_init()
88 assert_tsd_data_cleanup_done(tsd_t *tsd) { in assert_tsd_data_cleanup_done() argument
89 assert(!tsd_nominal(tsd)); in assert_tsd_data_cleanup_done()
90 assert(*tsd_arenap_get_unsafe(tsd) == NULL); in assert_tsd_data_cleanup_done()
91 assert(*tsd_iarenap_get_unsafe(tsd) == NULL); in assert_tsd_data_cleanup_done()
92 assert(*tsd_arenas_tdata_bypassp_get_unsafe(tsd) == true); in assert_tsd_data_cleanup_done()
93 assert(*tsd_arenas_tdatap_get_unsafe(tsd) == NULL); in assert_tsd_data_cleanup_done()
94 assert(*tsd_tcache_enabledp_get_unsafe(tsd) == false); in assert_tsd_data_cleanup_done()
95 assert(*tsd_prof_tdatap_get_unsafe(tsd) == NULL); in assert_tsd_data_cleanup_done()
99 tsd_data_init_nocleanup(tsd_t *tsd) { in tsd_data_init_nocleanup() argument
100 assert(tsd->state == tsd_state_reincarnated || in tsd_data_init_nocleanup()
101 tsd->state == tsd_state_minimal_initialized); in tsd_data_init_nocleanup()
107 rtree_ctx_data_init(tsd_rtree_ctxp_get_unsafe(tsd)); in tsd_data_init_nocleanup()
108 *tsd_arenas_tdata_bypassp_get(tsd) = true; in tsd_data_init_nocleanup()
109 *tsd_tcache_enabledp_get_unsafe(tsd) = false; in tsd_data_init_nocleanup()
110 *tsd_reentrancy_levelp_get(tsd) = 1; in tsd_data_init_nocleanup()
111 assert_tsd_data_cleanup_done(tsd); in tsd_data_init_nocleanup()
117 tsd_fetch_slow(tsd_t *tsd, bool minimal) { in tsd_fetch_slow() argument
118 assert(!tsd_fast(tsd)); in tsd_fetch_slow()
120 if (tsd->state == tsd_state_nominal_slow) { in tsd_fetch_slow()
122 assert(malloc_slow || !tsd_tcache_enabled_get(tsd) || in tsd_fetch_slow()
123 tsd_reentrancy_level_get(tsd) > 0 || in tsd_fetch_slow()
124 *tsd_arenas_tdata_bypassp_get(tsd)); in tsd_fetch_slow()
125 } else if (tsd->state == tsd_state_uninitialized) { in tsd_fetch_slow()
127 tsd->state = tsd_state_nominal; in tsd_fetch_slow()
128 tsd_slow_update(tsd); in tsd_fetch_slow()
130 tsd_set(tsd); in tsd_fetch_slow()
131 tsd_data_init(tsd); in tsd_fetch_slow()
133 tsd->state = tsd_state_minimal_initialized; in tsd_fetch_slow()
134 tsd_set(tsd); in tsd_fetch_slow()
135 tsd_data_init_nocleanup(tsd); in tsd_fetch_slow()
137 } else if (tsd->state == tsd_state_minimal_initialized) { in tsd_fetch_slow()
140 tsd->state = tsd_state_nominal; in tsd_fetch_slow()
141 assert(*tsd_reentrancy_levelp_get(tsd) >= 1); in tsd_fetch_slow()
142 (*tsd_reentrancy_levelp_get(tsd))--; in tsd_fetch_slow()
143 tsd_slow_update(tsd); in tsd_fetch_slow()
144 tsd_data_init(tsd); in tsd_fetch_slow()
146 assert_tsd_data_cleanup_done(tsd); in tsd_fetch_slow()
148 } else if (tsd->state == tsd_state_purgatory) { in tsd_fetch_slow()
149 tsd->state = tsd_state_reincarnated; in tsd_fetch_slow()
150 tsd_set(tsd); in tsd_fetch_slow()
151 tsd_data_init_nocleanup(tsd); in tsd_fetch_slow()
153 assert(tsd->state == tsd_state_reincarnated); in tsd_fetch_slow()
156 return tsd; in tsd_fetch_slow()
204 tsd_do_data_cleanup(tsd_t *tsd) { in tsd_do_data_cleanup() argument
205 prof_tdata_cleanup(tsd); in tsd_do_data_cleanup()
206 iarena_cleanup(tsd); in tsd_do_data_cleanup()
207 arena_cleanup(tsd); in tsd_do_data_cleanup()
208 arenas_tdata_cleanup(tsd); in tsd_do_data_cleanup()
209 tcache_cleanup(tsd); in tsd_do_data_cleanup()
210 witnesses_cleanup(tsd_witness_tsdp_get_unsafe(tsd)); in tsd_do_data_cleanup()
215 tsd_t *tsd = (tsd_t *)arg; in tsd_cleanup() local
217 switch (tsd->state) { in tsd_cleanup()
230 assert_tsd_data_cleanup_done(tsd); in tsd_cleanup()
234 tsd_do_data_cleanup(tsd); in tsd_cleanup()
235 tsd->state = tsd_state_purgatory; in tsd_cleanup()
236 tsd_set(tsd); in tsd_cleanup()
250 test_callback_t test_callback = *tsd_test_callbackp_get_unsafe(tsd); in tsd_cleanup()
251 int *data = tsd_test_datap_get_unsafe(tsd); in tsd_cleanup()
260 tsd_t *tsd; in malloc_tsd_boot0() local
266 tsd = tsd_fetch(); in malloc_tsd_boot0()
267 *tsd_arenas_tdata_bypassp_get(tsd) = true; in malloc_tsd_boot0()
268 return tsd; in malloc_tsd_boot0()
274 tsd_t *tsd = tsd_fetch(); in malloc_tsd_boot1() local
276 tsd_slow_update(tsd); in malloc_tsd_boot1()
277 *tsd_arenas_tdata_bypassp_get(tsd) = false; in malloc_tsd_boot1()