| 245 | } |
| 246 | |
| 247 | static void mi_thread_data_collect(void) { |
| 248 | // free all thread metadata from the cache |
| 249 | for (int i = 0; i < TD_CACHE_SIZE; i++) { |
| 250 | mi_thread_data_t* td = mi_atomic_load_ptr_relaxed(mi_thread_data_t, &td_cache[i]); |
| 251 | if (td != NULL) { |
| 252 | td = mi_atomic_exchange_ptr_acq_rel(mi_thread_data_t, &td_cache[i], NULL); |
| 253 | if (td != NULL) { |
| 254 | _mi_os_free( td, sizeof(mi_thread_data_t), &_mi_stats_main ); |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | // Initialize the thread local default heap, called from `mi_thread_init` |
| 261 | static bool _mi_heap_init(void) { |
no test coverage detected