mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-03 14:09:31 +03:00
add thread_local for c++
This commit is contained in:
parent
e8c27072a1
commit
a0a6ad3cf9
1 changed files with 6 additions and 0 deletions
|
@ -38,6 +38,12 @@ terms of the MIT license. A copy of the license can be found in the file
|
|||
#define mi_decl_cache_align __attribute__((aligned(MI_CACHE_LINE)))
|
||||
#define mi_decl_weak __attribute__((weak))
|
||||
#define mi_decl_hidden __attribute__((visibility("hidden")))
|
||||
#elif __cplusplus >= 201103L // c++11
|
||||
#define mi_decl_noinline
|
||||
#define mi_decl_thread thread_local
|
||||
#define mi_decl_cache_align alignas(MI_CACHE_LINE)
|
||||
#define mi_decl_weak
|
||||
#define mi_decl_hidden
|
||||
#else
|
||||
#define mi_decl_noinline
|
||||
#define mi_decl_thread __thread // hope for the best :-)
|
||||
|
|
Loading…
Add table
Reference in a new issue