1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

makeRegexCache(): Return a ref

This commit is contained in:
Eelco Dolstra 2025-10-27 14:11:59 +01:00
parent 1f6ac88efc
commit fdc5600fa7
2 changed files with 5 additions and 4 deletions

View file

@ -191,7 +191,7 @@ std::ostream & operator<<(std::ostream & os, const ValueType t);
struct RegexCache;
std::shared_ptr<RegexCache> makeRegexCache();
ref<RegexCache> makeRegexCache();
struct DebugTrace
{
@ -372,6 +372,7 @@ public:
const fetchers::Settings & fetchSettings;
const EvalSettings & settings;
SymbolTable symbols;
PosTable positions;
@ -504,7 +505,7 @@ private:
/**
* Cache used by prim_match().
*/
std::shared_ptr<RegexCache> regexCache;
const ref<RegexCache> regexCache;
public:

View file

@ -4611,9 +4611,9 @@ struct RegexCache
}
};
std::shared_ptr<RegexCache> makeRegexCache()
ref<RegexCache> makeRegexCache()
{
return std::make_shared<RegexCache>();
return make_ref<RegexCache>();
}
void prim_match(EvalState & state, const PosIdx pos, Value ** args, Value & v)