diff options
Diffstat (limited to 'src/vm/gcenv.ee.cpp')
-rw-r--r-- | src/vm/gcenv.ee.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp index baea98f4b9..2833c99aa6 100644 --- a/src/vm/gcenv.ee.cpp +++ b/src/vm/gcenv.ee.cpp @@ -725,10 +725,17 @@ void GCToEEInterface::GcEnumAllocContexts(enum_alloc_context_func* fn, void* par } CONTRACTL_END; - Thread * pThread = NULL; - while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL) + if (GCHeapUtilities::UseThreadAllocationContexts()) { - fn(pThread->GetAllocContext(), param); + Thread * pThread = NULL; + while ((pThread = ThreadStore::GetThreadList(pThread)) != NULL) + { + fn(pThread->GetAllocContext(), param); + } + } + else + { + fn(&g_global_alloc_context, param); } } @@ -1330,3 +1337,4 @@ void GCToEEInterface::EnableFinalization(bool foundFinalizers) FinalizerThread::EnableFinalization(); } } + |