From 682e970d2275f7fca21002f22cd5e79a7895e20b Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Wed, 19 Apr 2017 17:55:18 +0900 Subject: [PATCH] [x86/Linux] Do NOT run GC on Transition (dotnet/coreclr#11056) Commit migrated from https://github.com/dotnet/coreclr/commit/0f6bc8b3a6402706ea60ea68e26a73534091849c --- src/coreclr/src/vm/threads.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/coreclr/src/vm/threads.h b/src/coreclr/src/vm/threads.h index 6b8825c..34fca24 100644 --- a/src/coreclr/src/vm/threads.h +++ b/src/coreclr/src/vm/threads.h @@ -6735,30 +6735,29 @@ public: Thread::TriggersGC(GetThread()); \ } while(0) +#else // ENABLE_CONTRACTS_IMPL + +#define BEGINFORBIDGC() +#define ENDFORBIDGC() +#define TRIGGERSGC_NOSTOMP() ANNOTATION_GC_TRIGGERS +#define TRIGGERSGC() ANNOTATION_GC_TRIGGERS + +#endif // ENABLE_CONTRACTS_IMPL inline BOOL GC_ON_TRANSITIONS(BOOL val) { WRAPPER_NO_CONTRACT; +#ifdef _DEBUG Thread* thread = GetThread(); if (thread == 0) return(FALSE); BOOL ret = thread->m_GCOnTransitionsOK; thread->m_GCOnTransitionsOK = val; return(ret); +#else // _DEBUG + return FALSE; +#endif // !_DEBUG } -#else // _DEBUG_IMPL - -#define BEGINFORBIDGC() -#define ENDFORBIDGC() -#define TRIGGERSGC_NOSTOMP() ANNOTATION_GC_TRIGGERS -#define TRIGGERSGC() ANNOTATION_GC_TRIGGERS - -inline BOOL GC_ON_TRANSITIONS(BOOL val) { - return FALSE; -} - -#endif // _DEBUG_IMPL - #ifdef _DEBUG inline void ENABLESTRESSHEAP() { WRAPPER_NO_CONTRACT; -- 2.7.4