Commit e4bc1efe authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Skip global memory check for starting GC from a background thread

Currently background thread cannot allocate embedder objects and
checking the embedder heap size is not thread-safe. For simplicity,
we can skip the check until concurrent allocation of embedder objects
is supported.

Bug: chromium:1162744, chromium:1160097
Change-Id: I47d6299e77b986e4b2cb8da841e0149ef577918a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2640477Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72204}
parent af7e6893
......@@ -1793,12 +1793,8 @@ void Heap::StartIncrementalMarkingIfAllocationLimitIsReachedBackground() {
}
const size_t old_generation_space_available = OldGenerationSpaceAvailable();
const base::Optional<size_t> global_memory_available =
GlobalMemoryAvailable();
if (old_generation_space_available < new_space_->Capacity() ||
(global_memory_available &&
*global_memory_available < new_space_->Capacity())) {
if (old_generation_space_available < new_space_->Capacity()) {
incremental_marking()->incremental_marking_job()->ScheduleTask(this);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment