ignore: fix reference cycle for compiled matchers

It looks like there is a reference cycle caused by the compiled
matchers (compiled HashMap holds ref to Ignore and Ignore holds ref
to HashMap). Using weak refs fixes issue #2690 in my test project.
Also confirmed via before and after when profiling the code, see the
attached screenshots in #2692.

Fixes #2690
This commit is contained in:
fe9lix
2023-12-20 18:34:42 +01:00
committed by Andrew Gallant
parent 67dd809a80
commit b9c774937f
2 changed files with 18 additions and 7 deletions

View File

@@ -2,6 +2,11 @@
============
This is a minor release with a few small new features and bug fixes.
Bug fixes:
* [BUG #2664](https://github.com/BurntSushi/ripgrep/issues/2690):
Fix unbounded memory growth in the `ignore` crate.
Feature enhancements:
* [FEATURE #2684](https://github.com/BurntSushi/ripgrep/issues/2684):