_macos_currentThread should always be inlined

This commit is contained in:
K. Lange 2022-08-02 07:44:23 +09:00
parent efb73c8759
commit 85d64e05ac

View File

@ -239,6 +239,7 @@ typedef struct KrkVM {
extern void krk_forceThreadData(void); extern void krk_forceThreadData(void);
#define krk_currentThread (*_macos_currentThread()) #define krk_currentThread (*_macos_currentThread())
#pragma clang diagnostic ignored "-Wlanguage-extension-token" #pragma clang diagnostic ignored "-Wlanguage-extension-token"
__attribute__((always_inline))
inline KrkThreadState * _macos_currentThread(void) { inline KrkThreadState * _macos_currentThread(void) {
extern const uint64_t tls_desc[] asm("_krk_currentThread"); extern const uint64_t tls_desc[] asm("_krk_currentThread");
const uintptr_t * threadptr; asm ("mrs %0, TPIDRRO_EL0" : "=r"(threadptr)); const uintptr_t * threadptr; asm ("mrs %0, TPIDRRO_EL0" : "=r"(threadptr));