bsdiff
bsdiff copied to clipboard
Can the file write in bspatch be changed to stream?
Could bspatch write out a flush as it goes to avoid needing to allocate the entire file? It isn't clear to me if newpos is strictly increasing or not -- are ctrl[1] and ctrl[0] always positive?
I may answer too late but anyway: ctrl[0] & ctrl[1] are always positive.
Incidentally I thought about exactly this yesterday but I think it adds unnecessary complexity. Even if you stream target writes, you may still end up with max(ctrl[0], ctrl[1]) buffer size which may very well be the same as target size.
Unless you are hitting INT_MAX limitation on x86, I'd suggest to use target memory mapping instead. I didn't measure performance though.
Let me know of your thoughts.