cppgc-js: Explicitly initialize a moved-away struct
The struct is reused across various GC cycles and std::move() may leave the vector in valid but unspecified state. Change-Id: I3c40795be7397d015b96116d3549953024b98808 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160197 Auto-Submit: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Omer Katz <omerkatz@chromium.org> Reviewed-by: Anton Bikineev <bikineev@chromium.org> Cr-Commit-Position: refs/heads/main@{#76811}
This commit is contained in:
parent
b2c5afb9d8
commit
1461e09297
@ -254,6 +254,7 @@ void CppHeap::MetricRecorderAdapter::AddMainThreadEvent(
|
||||
if (incremental_mark_batched_events_.events.size() == kMaxBatchedEvents) {
|
||||
recorder->AddMainThreadEvent(std::move(incremental_mark_batched_events_),
|
||||
GetContextId());
|
||||
incremental_mark_batched_events_ = {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -272,6 +273,7 @@ void CppHeap::MetricRecorderAdapter::AddMainThreadEvent(
|
||||
if (incremental_sweep_batched_events_.events.size() == kMaxBatchedEvents) {
|
||||
recorder->AddMainThreadEvent(std::move(incremental_sweep_batched_events_),
|
||||
GetContextId());
|
||||
incremental_sweep_batched_events_ = {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,10 +284,12 @@ void CppHeap::MetricRecorderAdapter::FlushBatchedIncrementalEvents() {
|
||||
if (!incremental_mark_batched_events_.events.empty()) {
|
||||
recorder->AddMainThreadEvent(std::move(incremental_mark_batched_events_),
|
||||
GetContextId());
|
||||
incremental_mark_batched_events_ = {};
|
||||
}
|
||||
if (!incremental_sweep_batched_events_.events.empty()) {
|
||||
recorder->AddMainThreadEvent(std::move(incremental_sweep_batched_events_),
|
||||
GetContextId());
|
||||
incremental_sweep_batched_events_ = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user