mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-27 04:00:37 +00:00
!10073 SetProcessingRset 踩内存问题修改
Merge pull request !10073 from jinjiawei/waitsharedgc
This commit is contained in:
commit
26d41c69b2
@ -140,6 +140,15 @@ inline void RSetWorkListHandler::MergeBackForAllItem()
|
||||
}
|
||||
}
|
||||
|
||||
inline void RSetWorkListHandler::NotifyProcessRsetFinished()
|
||||
{
|
||||
LockHolder lock(mutex_);
|
||||
if (!processRsetFinished_) {
|
||||
heap_->SetProcessingRset(false);
|
||||
processRsetFinished_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool RSetWorkListHandler::MergeBack()
|
||||
{
|
||||
ASSERT((JSThread::GetCurrent()->IsJSThread() && JSThread::GetCurrent()->IsInRunningState()) ||
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
|
||||
inline void MergeBackForAllItem();
|
||||
|
||||
inline void NotifyProcessRsetFinished();
|
||||
|
||||
private:
|
||||
inline void CollectRSetItemsInHeap(const Heap *heap);
|
||||
|
||||
@ -83,6 +85,7 @@ private:
|
||||
* And thus WaitFinishedThenMergeBack should ONLY be called from the bound js thread in RUNNING state.
|
||||
*/
|
||||
bool initialized_ {false};
|
||||
bool processRsetFinished_ {false};
|
||||
std::vector<RSetItem> items_;
|
||||
std::atomic<int> nextItemIndex_ {-1};
|
||||
int remainItems_ {0};
|
||||
|
@ -173,7 +173,7 @@ inline void SharedGCMarkerBase::ProcessVisitorOfDoMark(uint32_t threadId)
|
||||
for (RSetWorkListHandler *handler : rSetHandlers_) {
|
||||
ECMA_BYTRACE_NAME(HITRACE_TAG_ARK, "SharedGCMarker::ProcessRSet");
|
||||
handler->ProcessAll(visitor);
|
||||
handler->GetHeap()->SetProcessingRset(false);
|
||||
handler->NotifyProcessRsetFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,6 +220,7 @@ inline void SharedGCMarkerBase::ProcessThenMergeBackRSetFromBoundJSThread(RSetWo
|
||||
ASSERT(JSThread::GetCurrent()->IsInRunningState());
|
||||
ProcessVisitor(handler);
|
||||
handler->WaitFinishedThenMergeBack();
|
||||
handler->NotifyProcessRsetFinished();
|
||||
}
|
||||
|
||||
void SharedGCMovableMarker::MarkObject(uint32_t threadId, TaggedObject *object, ObjectSlot &slot)
|
||||
|
Loading…
Reference in New Issue
Block a user