Skip to content

Commit

Permalink
regex: switch RegexSet to use WhichCaptures::None
Browse files Browse the repository at this point in the history
And this finally resolves the memory usage problem, as the PikeVM cache
used by the RegexSet in #1059 no longer allocates MBs of memory because
of the existence of impossible-to-use capturing groups.

Fixes #1059
  • Loading branch information
BurntSushi committed Aug 5, 2023
1 parent e29b915 commit 930770b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/builders.rs
Expand Up @@ -107,7 +107,7 @@ impl Builder {
.clone()
.match_kind(MatchKind::All)
.utf8_empty(true)
.which_captures(WhichCaptures::Implicit);
.which_captures(WhichCaptures::None);
let syntaxc = self.syntaxc.clone().utf8(true);
let patterns = Arc::from(self.pats.as_slice());
meta::Builder::new()
Expand All @@ -124,7 +124,7 @@ impl Builder {
.clone()
.match_kind(MatchKind::All)
.utf8_empty(false)
.which_captures(WhichCaptures::Implicit);
.which_captures(WhichCaptures::None);
let syntaxc = self.syntaxc.clone().utf8(false);
let patterns = Arc::from(self.pats.as_slice());
meta::Builder::new()
Expand Down

0 comments on commit 930770b

Please sign in to comment.