| 446 | } |
| 447 | |
| 448 | static 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 | |
| 459 | void _mi_heap_set_default_direct(mi_heap_t* heap) { |
| 460 | mi_assert_internal(heap != NULL); |
no test coverage detected