Skip to content

decompress: fix DDict hashset load factor calculation and reset cleanup - #4792

Open
filtede98 wants to merge 1 commit into
facebook:devfrom
filtede98:fix-ddict-hashset-load-factor-and-reset
Open

filtede98 wants to merge 1 commit into
facebook:devfrom
filtede98:fix-ddict-hashset-load-factor-and-reset

Conversation

@filtede98

Copy link
Copy Markdown

In ZSTD_DDictHashSet_addDDict(), missing parentheses in count * COUNT_MULT / size * SIZE_MULT caused left-to-right evaluation as ((count * 4) / size) * 3 != 0, triggering table expansion at 0.25 load factor instead of the documented 0.75 threshold.

Additionally, ddictSet was not cleared or freed when resetting context parameters or referencing NULL, retaining dangling dictionary references across resets.

In ZSTD_DDictHashSet_addDDict(), missing parentheses in count * COUNT_MULT / size * SIZE_MULT caused left-to-right evaluation as ((count * 4) / size) * 3 != 0, triggering table expansion at 0.25 load factor instead of the documented 0.75 threshold.

Additionally, ddictSet was not cleared or freed when resetting context parameters or referencing NULL, retaining dangling dictionary references across resets.
@meta-cla meta-cla Bot added the CLA Signed label Sep 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant