MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_thread_data_collect

Function mi_thread_data_collect

3rd/mimalloc-2.0.9/src/init.c:247–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247static 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`
261static bool _mi_heap_init(void) {

Callers 1

_mi_heap_doneFunction · 0.85

Calls 1

_mi_os_freeFunction · 0.85

Tested by

no test coverage detected