| 34 | } |
| 35 | |
| 36 | void ThreadLocalManager::PushTop(void* nodePtr, size_t nodeSize) { |
| 37 | auto& node = *static_cast<ThreadLocalNode<void>*>(nodePtr); |
| 38 | auto key = GetManager().m_key; |
| 39 | auto list = getList(pthread_getspecific(key)); |
| 40 | if (UNLIKELY(!list)) { |
| 41 | ThreadLocalSetValue(key, list = new ThreadLocalList); |
| 42 | } |
| 43 | node.m_next = list->head; |
| 44 | node.m_size = nodeSize; |
| 45 | list->head = node.m_next; |
| 46 | } |
| 47 | |
| 48 | ThreadLocalManager& ThreadLocalManager::GetManager() { |
| 49 | static ThreadLocalManager m; |
nothing calls this directly
no test coverage detected