From 1be130513b1713a875af475e5ddb9959e4a39bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Anic=CC=81?= Date: Wed, 7 Feb 2024 14:53:22 +0100 Subject: [PATCH] add notes about allocation --- src/deflate.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/deflate.zig b/src/deflate.zig index cd0219a..fffed2e 100644 --- a/src/deflate.zig +++ b/src/deflate.zig @@ -108,7 +108,10 @@ pub fn Compressor(comptime container: Container, comptime WriterType: type) type /// match. Otherwise, it emits the original match, and, as described above, /// advances N bytes before continuing. /// -/// This function accepts BlockWriterType so we can change that in test to test +/// +/// Allocates statically ~400K (192K lookup, 128K tokens, 64K window). +/// +/// Deflate function accepts BlockWriterType so we can change that in test to test /// just tokenization part. /// fn Deflate(comptime container: Container, comptime WriterType: type, comptime BlockWriterType: type) type { @@ -360,6 +363,9 @@ pub fn huffmanOnlyCompressor(comptime container: Container, writer: anytype) !Hu /// Creates huffman only deflate blocks. Disables Lempel-Ziv match searching and /// only performs Huffman entropy encoding. Results in faster compression, much /// less memory requirements during compression but bigger compressed sizes. +/// +/// Allocates ~11.2K +/// pub fn HuffmanOnlyCompressor(comptime container: Container, comptime WriterType: type) type { const BlockWriterType = BlockWriter(WriterType); return struct {