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

Function _mi_thread_done

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

Source from the content-addressed store, hash-verified

446}
447
448static void _mi_thread_done(mi_heap_t* heap) {
449 mi_atomic_decrement_relaxed(&thread_count);
450 _mi_stat_decrease(&_mi_stats_main.threads, 1);
451
452 // check thread-id as on Windows shutdown with FLS the main (exit) thread may call this on thread-local heaps...
453 if (heap->thread_id != _mi_thread_id()) return;
454
455 // abandon the thread local heap
456 if (_mi_heap_done(heap)) return; // returns true if already ran
457}
458
459void _mi_heap_set_default_direct(mi_heap_t* heap) {
460 mi_assert_internal(heap != NULL);

Callers 3

mi_fls_doneFunction · 0.85
mi_pthread_doneFunction · 0.85
mi_thread_doneFunction · 0.85

Calls 3

_mi_stat_decreaseFunction · 0.85
_mi_thread_idFunction · 0.85
_mi_heap_doneFunction · 0.85

Tested by

no test coverage detected