From fdc5600fa71eb13c547ed9909d71b44d41488fc0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Oct 2025 14:11:59 +0100 Subject: [PATCH] makeRegexCache(): Return a ref --- src/libexpr/include/nix/expr/eval.hh | 5 +++-- src/libexpr/primops.cc | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libexpr/include/nix/expr/eval.hh b/src/libexpr/include/nix/expr/eval.hh index 2640dae39..0c7f9cf09 100644 --- a/src/libexpr/include/nix/expr/eval.hh +++ b/src/libexpr/include/nix/expr/eval.hh @@ -191,7 +191,7 @@ std::ostream & operator<<(std::ostream & os, const ValueType t); struct RegexCache; -std::shared_ptr makeRegexCache(); +ref 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; + const ref regexCache; public: diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 5f06bf009..d87825a6d 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -4611,9 +4611,9 @@ struct RegexCache } }; -std::shared_ptr makeRegexCache() +ref makeRegexCache() { - return std::make_shared(); + return make_ref(); } void prim_match(EvalState & state, const PosIdx pos, Value ** args, Value & v)