Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index 38b8167d0d577560bac21ecbe3f70f0297dcb55c..2c998c8817a090478f0e209881aaad04efde6e61 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -3585,16 +3585,14 @@ int NumberOfPointerUpdateTasks(int pages) { |
template <PointerDirection direction> |
void UpdatePointersInParallel(Heap* heap) { |
- PageParallelJob<PointerUpdateJobTraits<direction> >* job = |
- new PageParallelJob<PointerUpdateJobTraits<direction> >( |
- heap, heap->isolate()->cancelable_task_manager()); |
+ PageParallelJob<PointerUpdateJobTraits<direction> > job( |
+ heap, heap->isolate()->cancelable_task_manager()); |
RememberedSet<direction>::IterateMemoryChunks( |
- heap, [job](MemoryChunk* chunk) { job->AddPage(chunk, 0); }); |
+ heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); }); |
PointersUpdatingVisitor visitor(heap); |
- int num_pages = job->NumberOfPages(); |
+ int num_pages = job.NumberOfPages(); |
int num_tasks = NumberOfPointerUpdateTasks(num_pages); |
- job->Run(num_tasks, [&visitor](int i) { return &visitor; }); |
- delete job; |
+ job.Run(num_tasks, [&visitor](int i) { return &visitor; }); |
} |
void MarkCompactCollector::UpdatePointersAfterEvacuation() { |