mirror of https://github.com/Wilfred/difftastic/
Ensure size_hint never exceeds graph_limit
If we have thousands of syntax nodes on both sides, we can end up attempting to preallocate a very large hashmap. In #542, a user hit an issue with two JSON files where the LHS had 33,000 syntax nodes and the RHS had 34,000 nodes, so we'd attempt to preallocate a hashmap of capacity 1,122,000,000. This required allocating 70,866,960,400 bytes (roughly 66 GiB). Impose a sensible limit on the hashmap. Fixes #542try_similar_lib
parent
c937f819a1
commit
892d4fdb58
Loading…
Reference in New Issue