repository: MasterIndex.ListPacks / Index.EachByPack allow earlier GC

Allow earlier garbage collection of some of the intermediate data
structures.
This commit is contained in:
Michael Eischer committed 2022-08-19 21:06:33 +02:00
1 parent 0d9ac78437
commit 6ff9517e45
2 files changed
+4

No files matched your search

+2
View File
@@ -294,6 +294,8 @@ func (idx *Index) EachByPack(ctx context.Context, packBlacklist restic.IDSet) <-
result.Blobs = append(result.Blobs, idx.toPackedBlob(e, restic.BlobType(typ)).Blob)
}
}
// allow GC once entry is no longer necessary
byPack[packID] = nil
select {
case <-ctx.Done():
return