summaryrefslogtreecommitdiffhomepage
path: root/KernelKit/ThreadLocalStorage.hxx
blob: 518adb327468aa882f64e23fda8f5a7a6d5c2a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 *	========================================================
 *
 *	hCore
 * 	Copyright 2024 Mahrouss Logic, all rights reserved.
 *
 * 	========================================================
 */

#ifndef _KERNELKIT_TLS_HPP
#define _KERNELKIT_TLS_HPP

#include <NewKit/Defines.hpp>

//! @brief TLS implementation in C++

#define kRTLMag0 'h'
#define kRTLMag1 'C'
#define kRTLMag2 'o'

template <typename T>
T* hcore_tls_new_ptr(void);

template <typename T>
bool hcore_tls_delete_ptr(T* ptr);

template <typename T, typename... Args>
T* hcore_tls_new_class(Args&&... args);

//! @brief Cookie Sanity check.
hCore::Boolean hcore_tls_check(hCore::VoidPtr ptr);

typedef char rt_cookie_type[3];

#include "ThreadLocalStorage.inl"

#endif /* ifndef _KERNELKIT_TLS_HPP */