| author | |
| committer | |
| log | 63fa151f1c29370cb3577b407d1b0e292e23299a |
| tree | f2e618b56024bd48662188c2746831878fa9b99e |
| parent | e204b2ca92d095cef03cee123881fd1d9f1004d0 |
This change corrects the size of various internal buffers used. The
previous behavior did not cause validity problems but wasted space.2 files changed, 3 insertions(+), 3 deletions(-)
lib/std/compress/zstandard.zig+2-2| ... | @@ -101,10 +101,10 @@ pub fn DecompressStream( | ... | @@ -101,10 +101,10 @@ pub fn DecompressStream( |
| 101 | ); | 101 | ); |
| 102 | const buffer = try RingBuffer.init(self.allocator, frame_context.window_size); | 102 | const buffer = try RingBuffer.init(self.allocator, frame_context.window_size); |
| 103 | 103 | ||
| 104 | const literals_data = try self.allocator.alloc(u8, options.window_size_max); | 104 | const literals_data = try self.allocator.alloc(u8, frame_context.block_size_max); |
| 105 | errdefer self.allocator.free(literals_data); | 105 | errdefer self.allocator.free(literals_data); |
| 106 | 106 | ||
| 107 | const sequence_data = try self.allocator.alloc(u8, options.window_size_max); | 107 | const sequence_data = try self.allocator.alloc(u8, frame_context.block_size_max); |
| 108 | errdefer self.allocator.free(sequence_data); | 108 | errdefer self.allocator.free(sequence_data); |
| 109 | 109 | ||
| 110 | self.literal_fse_buffer = literal_fse_buffer; | 110 | self.literal_fse_buffer = literal_fse_buffer; |
lib/std/compress/zstandard/types.zig+1-1| ... | @@ -391,7 +391,7 @@ pub const compressed_block = struct { | ... | @@ -391,7 +391,7 @@ pub const compressed_block = struct { |
| 391 | pub const table_size_max = struct { | 391 | pub const table_size_max = struct { |
| 392 | pub const literal = 1 << table_accuracy_log_max.literal; | 392 | pub const literal = 1 << table_accuracy_log_max.literal; |
| 393 | pub const match = 1 << table_accuracy_log_max.match; | 393 | pub const match = 1 << table_accuracy_log_max.match; |
| 394 | pub const offset = 1 << table_accuracy_log_max.match; | 394 | pub const offset = 1 << table_accuracy_log_max.offset; |
| 395 | }; | 395 | }; |
| 396 | }; | 396 | }; |
| 397 | 397 |