[K/N] Remove std_support allocation code ^KT-59008

This commit is contained in:
Alexander Shabalin
2023-08-10 19:31:13 +02:00
committed by Space Team
parent 002cd011d4
commit 49814ecb8a
110 changed files with 557 additions and 1078 deletions
@@ -16,7 +16,6 @@
#include "RuntimePrivate.hpp"
#include "Worker.h"
#include "KString.h"
#include "std_support/New.hpp"
#include <atomic>
#include <cstdlib>
#include <thread>
@@ -86,7 +85,7 @@ volatile GlobalRuntimeStatus globalRuntimeStatus = kGlobalRuntimeUninitialized;
RuntimeState* initRuntime() {
SetKonanTerminateHandler();
initObjectPool();
RuntimeState* result = new (std_support::kalloc) RuntimeState();
RuntimeState* result = new RuntimeState();
if (!result) return kInvalidRuntime;
RuntimeCheck(!isValidRuntime(), "No active runtimes allowed");
::runtimeState = result;
@@ -177,7 +176,7 @@ void deinitRuntime(RuntimeState* state, bool destroyRuntime) {
// Do not use ThreadStateGuard because memoryState will be destroyed during DeinitMemory.
kotlin::SwitchThreadState(state->memoryState, kotlin::ThreadState::kNative);
DeinitMemory(state->memoryState, destroyRuntime);
std_support::kdelete(state);
delete state;
WorkerDestroyThreadDataIfNeeded(workerId);
::runtimeState = kInvalidRuntime;
}