Skip to content

Commit

Permalink
deps: bump to memchr 2.6
Browse files Browse the repository at this point in the history
This bumps the minimum memchr version to 2.6, which brings in
massive improvements to aarch64 for single substring search. We also can
now enable the new `alloc` feature in `memchr` when `alloc` is enable
for `regex` and `regex-automata`.

We also squash some warnings.

[1]: BurntSushi/memchr#129
  • Loading branch information
BurntSushi committed Aug 29, 2023
1 parent 15cdc64 commit 9a505a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ std = [
# to actually emit the log messages somewhere.
logging = [
"aho-corasick?/logging",
"memchr?/logging",
"regex-automata/logging",
]
# The 'use_std' feature is DEPRECATED. It will be removed in regex 2. Until
Expand Down Expand Up @@ -167,7 +168,7 @@ optional = true

# For skipping along search text quickly when a leading byte is known.
[dependencies.memchr]
version = "2.5.0"
version = "2.6.0"
optional = true

# For the actual regex engines.
Expand Down
9 changes: 5 additions & 4 deletions fuzz/fuzz_targets/ast_fuzz_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ fuzz_target!(|data: FuzzData| -> Corpus {
let _ = env_logger::try_init();

let pattern = format!("{}", data.ast);
let Ok(re) = RegexBuilder::new(&pattern).size_limit(1<<20).build() else {
let Ok(re) = RegexBuilder::new(&pattern).size_limit(1 << 20).build()
else {
return Corpus::Reject;
};
re.is_match(&data.haystack);
re.find(&data.haystack);
re.captures(&data.haystack).map_or(0, |c| c.len());
let _ = re.is_match(&data.haystack);
let _ = re.find(&data.haystack);
let _ = re.captures(&data.haystack).map_or(0, |c| c.len());
Corpus::Keep
});
9 changes: 5 additions & 4 deletions fuzz/fuzz_targets/ast_fuzz_match_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ fuzz_target!(|data: FuzzData| -> Corpus {
let _ = env_logger::try_init();

let pattern = format!("{}", data.ast);
let Ok(re) = RegexBuilder::new(&pattern).size_limit(1<<20).build() else {
let Ok(re) = RegexBuilder::new(&pattern).size_limit(1 << 20).build()
else {
return Corpus::Reject;
};
re.is_match(&data.haystack);
re.find(&data.haystack);
re.captures(&data.haystack).map_or(0, |c| c.len());
let _ = re.is_match(&data.haystack);
let _ = re.find(&data.haystack);
let _ = re.captures(&data.haystack).map_or(0, |c| c.len());
Corpus::Keep
});
4 changes: 2 additions & 2 deletions regex-automata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bench = false
default = ["std", "syntax", "perf", "unicode", "meta", "nfa", "dfa", "hybrid"]
std = ["regex-syntax?/std", "memchr?/std", "aho-corasick?/std", "alloc"]
alloc = []
logging = ["dep:log", "aho-corasick?/logging"]
logging = ["dep:log", "aho-corasick?/logging", "memchr?/logging"]

syntax = ["dep:regex-syntax", "alloc"]

Expand Down Expand Up @@ -84,7 +84,7 @@ internal-instrument-pikevm = ["logging", "std"]
[dependencies]
aho-corasick = { version = "1.0.0", optional = true, default-features = false }
log = { version = "0.4.14", optional = true }
memchr = { version = "2.5.0", optional = true, default-features = false }
memchr = { version = "2.6.0", optional = true, default-features = false }
regex-syntax = { path = "../regex-syntax", version = "0.7.4", optional = true, default-features = false }

[dev-dependencies]
Expand Down

0 comments on commit 9a505a1

Please sign in to comment.