[K/N] Remove std_support allocation code ^KT-59008
This commit is contained in:
committed by
Space Team
parent
002cd011d4
commit
49814ecb8a
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user