diff options
Diffstat (limited to 'KernelKit/ThreadLocalStorage.inl')
| -rw-r--r-- | KernelKit/ThreadLocalStorage.inl | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/KernelKit/ThreadLocalStorage.inl b/KernelKit/ThreadLocalStorage.inl index c117dd4e..bf036366 100644 --- a/KernelKit/ThreadLocalStorage.inl +++ b/KernelKit/ThreadLocalStorage.inl @@ -12,39 +12,39 @@ template <typename T> inline T* hcore_tls_new_ptr(void) { - using namespace hCore; - - auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); - - T* pointer = (T*)ref_process.Leak().New(sizeof(T)); - return pointer; + using namespace hCore; + + auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); + + T* pointer = (T*)ref_process.Leak().New(sizeof(T)); + return pointer; } //! @brief TLS delete implementation. template <typename T> inline bool hcore_tls_delete_ptr(T* ptr) { - if (!ptr) - return false; - - using namespace hCore; - - auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); - ptr->~T(); - - return ref_process.Leak().Delete(ptr, sizeof(T)); + if (!ptr) + return false; + + using namespace hCore; + + auto ref_process = ProcessManager::Shared().Leak().GetCurrent(); + ptr->~T(); + + return ref_process.Leak().Delete(ptr, sizeof(T)); } template <typename T, typename... Args> T* hcore_tls_new_class(Args&&... args) { - T* ptr = hcore_tls_new_ptr<T>(); - - if (ptr) - { - *ptr = T(hCore::forward(args)...); - return ptr; - } - - return nullptr; + T* ptr = hcore_tls_new_ptr<T>(); + + if (ptr) + { + *ptr = T(hCore::forward(args)...); + return ptr; + } + + return nullptr; } |
