summaryrefslogtreecommitdiff
path: root/src/vm/methodtablebuilder.cpp
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-10-04 10:26:06 +0200
committerGitHub <noreply@github.com>2018-10-04 10:26:06 +0200
commit7559844bbe9e4230217a9a9cf4be8a857531c8c8 (patch)
treec1ad22769c0091396307d555a5959ecdc0dfed31 /src/vm/methodtablebuilder.cpp
parent11832401739148f1f1e9419cb51180ba5263a41b (diff)
downloadcoreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.tar.gz
coreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.tar.bz2
coreclr-7559844bbe9e4230217a9a9cf4be8a857531c8c8.zip
Enable thread statics for collectible classes (#19944)
* Enable thread statics for collectible classes This change removes checks that were preventing usage of thread statics in collectible classes and also implements all the necessary changes. The handles that hold arrays with thread statics are allocated from LoaderAllocator for collectible classes instead of using the global strong handle like in the case of non-collectible classes. The change very much mimics what is done for regular statics. This change also adds ability to reuse freed handles to the LoaderAllocator handle table. Freed handle indexes are stored into a stack and when a new handle allocation is requested, the indices from this stack are used first. Due to the code path from which the FreeTLM that in turn frees the handles is called, I had to modify the critical section flags and also refactor the handle allocation so that the actual managed array representing the handle table is allocated out of the critical section. When I was touching the code, I have also moved the code that was dealing with handles that are not stored in the LoaderAllocator handle tables out of the critical section, since there is no point in having it inside of it.
Diffstat (limited to 'src/vm/methodtablebuilder.cpp')
-rw-r--r--src/vm/methodtablebuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index 56397ca267..15ce7d2af3 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -3822,7 +3822,7 @@ VOID MethodTableBuilder::InitializeFieldDescs(FieldDesc *pFieldDescList,
IfFailThrow(COR_E_TYPELOAD);
}
- if ((fIsThreadStatic || fIsContextStatic || bmtFP->fHasFixedAddressValueTypes) && GetAssembly()->IsCollectible())
+ if ((fIsContextStatic || bmtFP->fHasFixedAddressValueTypes) && GetAssembly()->IsCollectible())
{
if (bmtFP->fHasFixedAddressValueTypes)
{
@@ -6529,7 +6529,7 @@ VOID MethodTableBuilder::PlaceInterfaceDeclarationOnClass(
}
}
#endif
-
+
#ifdef _DEBUG
if (bmtInterface->dbg_fShouldInjectInterfaceDuplicates)
{ // We injected interface duplicates