| ... | @@ -1410,12 +1410,13 @@ fn workerMakeOneStep( | ... | @@ -1410,12 +1410,13 @@ fn workerMakeOneStep( |
| 1410 | if (s.max_rss != 0) { | 1410 | if (s.max_rss != 0) { |
| 1411 | var dispatch_deps: std.ArrayList(*Step) = .empty; | 1411 | var dispatch_deps: std.ArrayList(*Step) = .empty; |
| 1412 | defer dispatch_deps.deinit(gpa); | 1412 | defer dispatch_deps.deinit(gpa); |
| 1413 | dispatch_deps.ensureUnusedCapacity(gpa, run.memory_blocked_steps.items.len) catch @panic("OOM"); | | |
| 1414 | | 1413 | |
| 1415 | { | 1414 | { |
| 1416 | run.max_rss_mutex.lockUncancelable(io); | 1415 | run.max_rss_mutex.lockUncancelable(io); |
| 1417 | defer run.max_rss_mutex.unlock(io); | 1416 | defer run.max_rss_mutex.unlock(io); |
| 1418 | | 1417 | |
| | 1418 | dispatch_deps.ensureUnusedCapacity(gpa, run.memory_blocked_steps.items.len) catch @panic("OOM"); |
| | 1419 | |
| 1419 | // Give the memory back to the scheduler. | 1420 | // Give the memory back to the scheduler. |
| 1420 | run.claimed_rss -= s.max_rss; | 1421 | run.claimed_rss -= s.max_rss; |
| 1421 | // Avoid kicking off too many tasks that we already know will not have | 1422 | // Avoid kicking off too many tasks that we already know will not have |