Skip to content

Commit

Permalink
Merge pull request #73 from JuliaData/jps/sra-ctr-update-fix
Browse files Browse the repository at this point in the history
sra_migrate!: Fix improper deleteat-in-loop
  • Loading branch information
jpsamaroo authored Nov 15, 2023
2 parents 033413a + c5e7047 commit fa35a59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -950,12 +950,14 @@ function sra_migrate!(sra::SimpleRecencyAllocator, state::RefState, ref_id, to_m
end

# Update counters
to_delete = Int[]
for oref in Iterators.map(idx->from_refs[idx], write_list)
push!(to_refs, oref)
if !(!to_mem && sra.retain[])
deleteat!(from_refs, findfirst(==(oref), from_refs))
push!(to_delete, findfirst(==(oref), from_refs))
end
end
foreach(idx->deleteat!(from_refs, idx), reverse(to_delete))

@label write_ref
# Space available, perform migration
Expand Down

0 comments on commit fa35a59

Please sign in to comment.