Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant buffer size in lh_new_decoder.c #36

Open
el89 opened this issue Jan 5, 2022 · 0 comments
Open

Redundant buffer size in lh_new_decoder.c #36

el89 opened this issue Jan 5, 2022 · 0 comments

Comments

@el89
Copy link

el89 commented Jan 5, 2022

I found that ringbuf is twice larger than really needed.

Say, for lh5 the dictionary size is 8KiB. Given HISTORY_BITS=14, the maximum value returned by read_offset_code function is 8191, thus the max offset for a copy command is 8192. However, lh_new_decoder.c creates ringbuf of size 1<<HISTORY_BITS, that is twice larger than needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant