diff options
author | Juan Hoyos <juan.hoyos@microsoft.com> | 2019-08-19 19:21:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 19:21:40 -0700 |
commit | ecb4575a825e8a6aa21f9775bc8005524e56e03d (patch) | |
tree | 9c4e8e2ed676dcf3a769c6e01ad65bc01b945214 /src | |
parent | 6d8482c379f67a00d63acd823ef351497a7bba4d (diff) | |
download | coreclr-ecb4575a825e8a6aa21f9775bc8005524e56e03d.tar.gz coreclr-ecb4575a825e8a6aa21f9775bc8005524e56e03d.tar.bz2 coreclr-ecb4575a825e8a6aa21f9775bc8005524e56e03d.zip |
Use function-local StackingAllocator for EnC added methods (#26256)
As adding EnC methods happens on the Debugger Thread, there's no managed Thread object from which to obtain the cached StackingAllocator. Instead, just use a function-local StackingAllocator.
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/class.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vm/class.cpp b/src/vm/class.cpp index e52ca61f50..1cc1358d4e 100644 --- a/src/vm/class.cpp +++ b/src/vm/class.cpp @@ -604,12 +604,16 @@ HRESULT EEClass::AddMethod(MethodTable * pMT, mdMethodDef methodDef, RVA newRVA, // Get the new MethodDesc (Note: The method desc memory is zero initialized) MethodDesc *pNewMD = pChunk->GetFirstMethodDesc(); - ACQUIRE_STACKING_ALLOCATOR(pStackingAllocator); // Initialize the new MethodDesc + + // This method runs on a debugger thread. Debugger threads do not have Thread object that caches StackingAllocator. + // Use a local StackingAllocator instead. + StackingAllocator stackingAllocator; + MethodTableBuilder builder(pMT, pClass, - pStackingAllocator, + &stackingAllocator, &dummyAmTracker); EX_TRY { |