!6528 Fix code check

Merge pull request !6528 from xiongluo/code_check
This commit is contained in:
weng-changcheng 2024-03-18 07:27:50 +00:00 committed by Gitee
commit 3e0935b03c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 6 additions and 2 deletions

View File

@ -228,7 +228,6 @@ bool HeapProfiler::UpdateHeapTracking(Stream *stream)
UpdateHeapObjects(snapshot);
}
if (stream != nullptr) {
snapshot->PushHeapStat(stream);
}

View File

@ -251,7 +251,12 @@ bool JSThread::EnableGlobalPrimitiveLeakCheck() const
bool JSThread::IsInRunningStateOrProfiling() const
{
return IsInRunningState() || vm_->GetHeapProfile() != nullptr;
bool result = IsInRunningState();
#if defined(ECMASCRIPT_SUPPORT_HEAPPROFILER)
return result || vm_->GetHeapProfile() != nullptr;
#else
return result;
#endif
}
void JSThread::WriteToStackTraceFd(std::ostringstream &buffer) const