Closed gendx closed 4 years ago
Added some tests in 43d806c4474491d30cd36709afb2961362978046, it seems that vec![0; size]
already grows on-demand when data is accessed (at least on Linux). But this may not be the case on other platforms, and the allocation could fail if there is not enough RAM, so a fix is still welcome.
Fixed by #22.
The current implementation of
LZBuffer
allocates the full dictionary size in the constructor, even if the decompressed file is much smaller, which can slow down decompression for small files. Use a dynamic strategy to grow the dictionary on-demand instead, or check the decompressed size in the header (if provided).