Spool large files to disk during extraction to save memory

This commit is contained in:
Timothy Baldridge
2020-09-07 20:22:23 -06:00
parent 9de30ea8b7
commit 5d7bceb6dc
6 changed files with 127 additions and 39 deletions

View File

@ -27,6 +27,10 @@ namespace Wabbajack.VirtualFileSystem
public static async Task<Dictionary<RelativePath, T>> GatheringExtract<T>(IStreamFactory sFn,
Predicate<RelativePath> shouldExtract, Func<RelativePath, IStreamFactory, ValueTask<T>> mapfn)
{
if (sFn is NativeFileStreamFactory)
{
Utils.Log($"Extracting {sFn.Name}");
}
await using var archive = await sFn.GetStream();
var sig = await ArchiveSigs.MatchesAsync(archive);
archive.Position = 0;