Open nemequ opened 9 years ago
I've created a wip/reset branch for this.
Everything is working except for the brotli plugin, which gets stuck not processing any data in the new "reset" test (no data is read or written by calls to squash_process
). I think this may be an issue with the plugin outside of the changes required for making the stream resettable, since it sounds a lot like what is described at https://groups.google.com/forum/#!topic/squash-compression/hGNOqux2dlc
@eustas mentioned a plan to update the brotli plugin for Squash soon, I may just wait until then and see if that fixes the issue.
zlib (at least, probably a couple others) are able to reset a stream without freeing and reallocating it, which can save a lot of time. It would probably require some changes to how we create streams in plugins, but it should be possible to expose this functionality in plugins which support it while emulating the feature (by freeing the old instance and creating a new one) for plugins which don't.