!6771 Add managedScope for GetLiveObjectSize

Merge pull request !6771 from xiongluo/managed_scope
This commit is contained in:
openharmony_ci 2024-04-02 18:34:23 +00:00 committed by Gitee
commit a0dc05cc70
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -377,6 +377,7 @@ void DFXJSNApi::StopRuntimeStat(EcmaVM *vm)
size_t DFXJSNApi::GetArrayBufferSize(const EcmaVM *vm)
{
ecmascript::ThreadManagedScope managedScope(vm->GetJSThread());
return vm->GetHeap()->GetArrayBufferSize();
}
@ -387,6 +388,7 @@ size_t DFXJSNApi::GetHeapTotalSize(const EcmaVM *vm)
size_t DFXJSNApi::GetHeapUsedSize(const EcmaVM *vm)
{
ecmascript::ThreadManagedScope managedScope(vm->GetJSThread());
return vm->GetHeap()->GetLiveObjectSize();
}