Remove unneeded zeroing TLS (#4480)

This commit is contained in:
Alexander Shabalin
2020-10-29 22:20:31 +03:00
committed by Stanislav Erokhin
parent 1a97a6ca1a
commit 4297b521e4
5 changed files with 25 additions and 12 deletions
@@ -224,11 +224,6 @@ KBoolean Konan_Platform_isDebugBinary() {
return KonanNeedDebugInfo ? true : false;
}
void Kotlin_zeroOutTLSGlobals() {
if (runtimeState != nullptr && runtimeState->memoryState != nullptr)
InitOrDeinitGlobalVariables(DEINIT_THREAD_LOCAL_GLOBALS, runtimeState->memoryState);
}
bool Kotlin_memoryLeakCheckerEnabled() {
return g_checkLeaks;
}
@@ -31,9 +31,6 @@ void Kotlin_deinitRuntimeIfNeeded();
// Appends given node to an initializer list.
void AppendToInitializersTail(struct InitNode*);
// Zero out all Kotlin thread local globals.
void Kotlin_zeroOutTLSGlobals();
bool Kotlin_memoryLeakCheckerEnabled();
bool Kotlin_cleanersLeakCheckerEnabled();
@@ -815,10 +815,6 @@ void* workerRoutine(void* argument) {
if (worker->processQueueElement(true) == JOB_TERMINATE) break;
} while (true);
// Runtime deinit callback could be called when TLS is already zeroed out, so clear memory
// here explicitly. to make sure leak detector properly works.
Kotlin_zeroOutTLSGlobals();
return nullptr;
}