diff options
Diffstat (limited to 'src/vm/gcstress.h')
-rw-r--r-- | src/vm/gcstress.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vm/gcstress.h b/src/vm/gcstress.h index 04487c611e..edf92a947c 100644 --- a/src/vm/gcstress.h +++ b/src/vm/gcstress.h @@ -286,7 +286,12 @@ namespace _GCStress public: FORCEINLINE static void Trigger() - { GCHeapUtilities::GetGCHeap()->StressHeap(); } + { + // BUG(github #10318) - when not using allocation contexts, the alloc lock + // must be acquired here. Until fixed, this assert prevents random heap corruption. + _ASSERTE(GCHeapUtilities::UseThreadAllocationContexts()); + GCHeapUtilities::GetGCHeap()->StressHeap(GetThread()->GetAllocContext()); + } FORCEINLINE static void Trigger(::gc_alloc_context* acontext) |