std.zip expand: memory allocation failed
Steven Schveighoffer
schveiguy at gmail.com
Tue Oct 26 20:33:17 UTC 2021
On 10/26/21 1:38 PM, Imperatorn wrote:
>
> That's the current implementation.
No, that's the API. You cannot fix the implementation with that API and
not end up allocating an array to hold the entire unzipped contents. You
can't even decompress to a file, and then mmap those contents -- the
address space isn't there.
> I don't know about *nix, but my Windows machine can easily extract a
> file bigger than my RAM.
zlib does not require decompressing in entirety. This is just the way
that std.zip decided to expose the API. e.g. iopipe uses an expandable
buffer for decompression and compression, which does not have to contain
the entire file.
-Steve
More information about the Digitalmars-d-learn
mailing list