summaryrefslogtreecommitdiff
path: root/src/vm/gcstress.h
diff options
context:
space:
mode:
authorSean Gillespie <sean@swgillespie.me>2017-03-22 10:25:08 -0700
committerGitHub <noreply@github.com>2017-03-22 10:25:08 -0700
commit992d37064fa76ea7633734607381545e228806a5 (patch)
tree4b7cf456449feb58ee126fe4a065bb8f2ad54afb /src/vm/gcstress.h
parentc2ba64de40e5e28c56b9734521c5f6ead20bdea9 (diff)
downloadcoreclr-992d37064fa76ea7633734607381545e228806a5.tar.gz
coreclr-992d37064fa76ea7633734607381545e228806a5.tar.bz2
coreclr-992d37064fa76ea7633734607381545e228806a5.zip
Fix an issue where GCStress allocated objects using the Gen 0 alloc context (#10322)
* Fix an issue where GCStress allocated objects using the Gen 0 alloc context * Remove a GCStress MaybeTrigger on LOH allocations that attempted to use the gen 0 alloc context
Diffstat (limited to 'src/vm/gcstress.h')
-rw-r--r--src/vm/gcstress.h7
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)