Unnecessary allocation in ZipWriter? #132

Closed
opened 2026-01-29 22:07:07 +00:00 by claunia · 2 comments
Owner

Originally created by @UnknownShadow200 on GitHub (Sep 30, 2016).

Noticed this line in ZipWriter.cs

private readonly PpmdProperties ppmdProperties = new PpmdProperties();

ends up calling Allocator.Start() which allocates a 16 megabyte byte array.

I assume this field is only meant to be assigned when PPMd compression type?

Originally created by @UnknownShadow200 on GitHub (Sep 30, 2016). Noticed this line in ZipWriter.cs ``` CSharp private readonly PpmdProperties ppmdProperties = new PpmdProperties(); ``` ends up calling Allocator.Start() which allocates a 16 megabyte byte array. I assume this field is only meant to be assigned when PPMd compression type?
Author
Owner

@adamhathcock commented on GitHub (Sep 30, 2016):

Yeah, looks bad. I'll look into fixing that shortly

@adamhathcock commented on GitHub (Sep 30, 2016): Yeah, looks bad. I'll look into fixing that shortly
Author
Owner

@adamhathcock commented on GitHub (Oct 3, 2016):

https://www.nuget.org/packages/sharpcompress/0.13.1

@adamhathcock commented on GitHub (Oct 3, 2016): https://www.nuget.org/packages/sharpcompress/0.13.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#132