mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
[Bug]: 修复new HeapProfiler时崩溃问题
desc: 修复new HeapProfiler时崩溃问题 solu: 使用原生new方式创建对象,而不使用NativeAreaAllocator来创建 issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8KTZV Signed-off-by: wanghuan2022 <wanghuan80@huawei.com> Change-Id: Ic2d93cc4ae3455d443db4bcd0a016fc18bdee75b
This commit is contained in:
parent
ecb7342211
commit
64a7fafc5d
@ -521,7 +521,7 @@ void EcmaVM::DeleteHeapProfile()
|
||||
if (heapProfile_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
const_cast<NativeAreaAllocator *>(GetNativeAreaAllocator())->Delete(heapProfile_);
|
||||
delete heapProfile_;
|
||||
heapProfile_ = nullptr;
|
||||
}
|
||||
|
||||
@ -538,7 +538,7 @@ HeapProfilerInterface *EcmaVM::GetOrNewHeapProfile()
|
||||
if (heapProfile_ != nullptr) {
|
||||
return heapProfile_;
|
||||
}
|
||||
heapProfile_ = const_cast<NativeAreaAllocator *>(GetNativeAreaAllocator())->New<HeapProfiler>(this);
|
||||
heapProfile_ = new HeapProfiler(this);
|
||||
ASSERT(heapProfile_ != nullptr);
|
||||
return heapProfile_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user