WeakVec
should consider using Vec::swap_remove
instead of a freelist
#6580
Labels
WeakVec
should consider using Vec::swap_remove
instead of a freelist
#6580
wgpu_core::weak_vec::WeakVec
maintains a freelist, but it's not important that elements stay at their original indices, so it should be possible to usestd::vec::Vec::swap_remove
to remove broken weak references, thus keeping all live references contiguous at the start of the vector, making the freelist unnecessary.The text was updated successfully, but these errors were encountered: