[K/N][New MM] Move ThreadStateGuard to the main Memory.h
Integrating the stdlib with the thread states machinery requires accessing to some parts of the new MM. This patch provides this access by moving these parts to the main Memory.h header.
This commit is contained in:
committed by
TeamCityServer
parent
482305cfb2
commit
6643119f08
@@ -427,3 +427,15 @@ extern "C" RUNTIME_NOTHROW void Kotlin_mm_safePointExceptionUnwind() {
|
||||
auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData();
|
||||
threadData->gc().SafePointExceptionUnwind();
|
||||
}
|
||||
|
||||
extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void Kotlin_mm_switchThreadStateNative() {
|
||||
SwitchThreadState(mm::ThreadRegistry::Instance().CurrentThreadData(), ThreadState::kNative);
|
||||
}
|
||||
|
||||
extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void Kotlin_mm_switchThreadStateRunnable() {
|
||||
SwitchThreadState(mm::ThreadRegistry::Instance().CurrentThreadData(), ThreadState::kRunnable);
|
||||
}
|
||||
|
||||
MemoryState* kotlin::mm::GetMemoryState() {
|
||||
return ToMemoryState(ThreadRegistry::Instance().CurrentThreadDataNode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user