std.zip expand: memory allocation failed
Imperatorn
johan_forsberg_86 at hotmail.com
Tue Oct 26 21:16:25 UTC 2021
On Tuesday, 26 October 2021 at 20:33:17 UTC, Steven Schveighoffer
wrote:
> 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
Yes, that's how it's written. That's the problem.
More information about the Digitalmars-d-learn
mailing list