Initialize thread, assign heap
| 1994 | |
| 1995 | //! Initialize thread, assign heap |
| 1996 | extern inline void |
| 1997 | rpmalloc_thread_initialize(void) { |
| 1998 | if (!get_thread_heap_raw()) { |
| 1999 | heap_t* heap = _memory_allocate_heap(); |
| 2000 | if (heap) { |
| 2001 | atomic_thread_fence_acquire(); |
| 2002 | #if ENABLE_STATISTICS |
| 2003 | atomic_incr32(&_memory_active_heaps); |
| 2004 | #endif |
| 2005 | set_thread_heap(heap); |
| 2006 | #if defined(_MSC_VER) && !defined(__clang__) && (!defined(BUILD_DYNAMIC_LINK) || !BUILD_DYNAMIC_LINK) |
| 2007 | FlsSetValue(fls_key, heap); |
| 2008 | #endif |
| 2009 | } |
| 2010 | } |
| 2011 | } |
| 2012 | |
| 2013 | //! Finalize thread, orphan heap |
| 2014 | void |
no test coverage detected