[K/N][New MM] Move RunInNewThread to the main ThreadSupport.hpp

Some of unit-tests for the C++ part of the stdlib will require
thread state switching. In the new MM, we already have a helper
function that allows us to scopely initialize the memory subsystem
for a separate thread. This patch makes this helper available
for tests in the main runtime module by moving it to the main
ThreadSupport.hpp.
This commit is contained in:
Ilya Matveev
2021-02-28 21:11:29 +07:00
committed by TeamCityServer
parent fc43fbf578
commit 482305cfb2
8 changed files with 101 additions and 34 deletions
+1 -2
View File
@@ -99,8 +99,7 @@ extern "C" void RestoreMemory(MemoryState*) {
}
extern "C" void ClearMemoryForTests(MemoryState* state) {
auto* threadData = FromMemoryState(state)->Get();
threadData->ClearForTests();
state->GetThreadData()->ClearForTests();
}
extern "C" RUNTIME_NOTHROW OBJ_GETTER(AllocInstance, const TypeInfo* typeInfo) {