Closed chris0e3 closed 7 months ago
No. In the LIT_MEM case, the actual pending buffer is 80% of the space allocated for the thing called pending_buf
. Perhaps a little confusing, but quite intentional. That extra space is needed to keep the pending buffer data from catching up with the symbol data written into the same allocated memory.
Sure, I suppose it could be heap[HEAP_SIZE]
. Though I kind of like it the way it is, as it is immediately obvious to someone familiar with building binary trees that you need 2n+1 nodes for n leaves. Maybe I'll get rid of the HEAP_SIZE
macro.
Hello,
Thanks for all your work on zlib. I’ve used it for many years.
I was merging in the latest changes from v1.3.1 to my local copy when I noticed this:
https://github.com/madler/zlib/blob/9f0f2d4f9f1f28be7e16d8bf3b4e9d4ada70aa9f/deflate.c#L496-L497 Should it not be (note very last symbol):
As implied by: https://github.com/madler/zlib/blob/9f0f2d4f9f1f28be7e16d8bf3b4e9d4ada70aa9f/deflate.h#L108
At the same time I also noticed: https://github.com/madler/zlib/blob/9f0f2d4f9f1f28be7e16d8bf3b4e9d4ada70aa9f/deflate.h#L213 should this be written (just for consistency) as:
And perhaps this should have the same change (if it’s required to match
heap
): https://github.com/madler/zlib/blob/9f0f2d4f9f1f28be7e16d8bf3b4e9d4ada70aa9f/deflate.h#L220Regards,
CHRIS