diff options
Diffstat (limited to 'packaging/0023-vm-threads-change-tls-model-for-gCurrentThreadInfo-v.patch')
-rw-r--r-- | packaging/0023-vm-threads-change-tls-model-for-gCurrentThreadInfo-v.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packaging/0023-vm-threads-change-tls-model-for-gCurrentThreadInfo-v.patch b/packaging/0023-vm-threads-change-tls-model-for-gCurrentThreadInfo-v.patch new file mode 100644 index 0000000000..9976ee1fb9 --- /dev/null +++ b/packaging/0023-vm-threads-change-tls-model-for-gCurrentThreadInfo-v.patch @@ -0,0 +1,29 @@ +From df179b357e12c57b5e0caa8a1427a344bdae812f Mon Sep 17 00:00:00 2001 +From: Konstantin Baladurin <k.baladurin@partner.samsung.com> +Date: Tue, 13 Feb 2018 16:14:37 +0300 +Subject: [PATCH 23/47] vm/threads: change tls model for gCurrentThreadInfo + variable + +We should use initial-exec tls model to avoid memory allocations +during first access to this variable because it may ocuur in +signal handlers. +--- + src/vm/threads.inl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/vm/threads.inl b/src/vm/threads.inl +index 26682ec..0105955 100644 +--- a/src/vm/threads.inl ++++ b/src/vm/threads.inl +@@ -27,7 +27,7 @@ + #ifndef __llvm__ + EXTERN_C __declspec(thread) ThreadLocalInfo gCurrentThreadInfo; + #else // !__llvm__ +-EXTERN_C __thread ThreadLocalInfo gCurrentThreadInfo; ++EXTERN_C __thread ThreadLocalInfo gCurrentThreadInfo __attribute__ ((tls_model("initial-exec"))); + #endif // !__llvm__ + + EXTERN_C inline Thread* STDCALL GetThread() +-- +2.7.4 + |