mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-06 23:54:03 +00:00
!9555 Fix new js error before vm initialize bug
Merge pull request !9555 from dingwen/oom_br
This commit is contained in:
commit
2ff5e5f214
@ -1085,11 +1085,11 @@ void Heap::CollectGarbage(TriggerGCType gcType, GCReason reason)
|
||||
UNREACHABLE();
|
||||
}
|
||||
#endif
|
||||
RecursionScope recurScope(this, HeapType::LOCAL_HEAP);
|
||||
if (thread_->IsCrossThreadExecutionEnable() || GetOnSerializeEvent()) {
|
||||
ProcessGCListeners();
|
||||
return;
|
||||
}
|
||||
RecursionScope recurScope(this, HeapType::LOCAL_HEAP);
|
||||
#if defined(ECMASCRIPT_SUPPORT_CPUPROFILER)
|
||||
[[maybe_unused]] GcStateScope scope(thread_);
|
||||
#endif
|
||||
|
@ -48,7 +48,7 @@ Region *HeapRegionAllocator::AllocateAlignedRegion(Space *space, size_t capacity
|
||||
Jit::GetInstance()->IsEnableJitFort());
|
||||
void *mapMem = pool.GetMem();
|
||||
if (mapMem == nullptr) {
|
||||
if (thread != nullptr) {
|
||||
if (thread != nullptr && thread->GetEcmaVM()->IsInitialized()) {
|
||||
heap->ThrowOutOfMemoryErrorForDefault(thread, DEFAULT_REGION_SIZE,
|
||||
"HeapRegionAllocator::AllocateAlignedRegion", false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user