| 702 | } |
| 703 | |
| 704 | void ChannelImpl::real_free(TensorInfo* ptr) { |
| 705 | auto& state = get_worker_state(); |
| 706 | if (ptr->size_exceeds_thd(state.options.dtr_evictee_minimum_size)) { |
| 707 | m_dtr.erase_candidate(ptr); |
| 708 | } |
| 709 | detach_users(ptr); |
| 710 | ptr->detach_producer(); |
| 711 | bool has_value = ptr->ptr != nullptr; |
| 712 | if (has_value) { |
| 713 | MGB_RECORD_EVENT(TensorReleaseEvent, ptr->id); |
| 714 | } |
| 715 | MGB_RECORD_EVENT(TensorEraseEvent, ptr->id, ptr->ptr_use_count); |
| 716 | ptr->status = TensorInfo::Deleted; |
| 717 | MGB_LOCK_GUARD(m_pool_spin); |
| 718 | m_pool.free(ptr); |
| 719 | } |
| 720 | |
| 721 | std::unordered_set<ChannelImpl*> ChannelImpl::m_all_active_channels{}; |
| 722 | MGB_MUTEX ChannelImpl::m_all_active_channels_mutex{}; |
nothing calls this directly
no test coverage detected