Skip to content

Commit fdc5600

Browse files
committed
makeRegexCache(): Return a ref
1 parent 1f6ac88 commit fdc5600

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/libexpr/include/nix/expr/eval.hh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ std::ostream & operator<<(std::ostream & os, const ValueType t);
191191

192192
struct RegexCache;
193193

194-
std::shared_ptr<RegexCache> makeRegexCache();
194+
ref<RegexCache> makeRegexCache();
195195

196196
struct DebugTrace
197197
{
@@ -372,6 +372,7 @@ public:
372372

373373
const fetchers::Settings & fetchSettings;
374374
const EvalSettings & settings;
375+
375376
SymbolTable symbols;
376377
PosTable positions;
377378

@@ -504,7 +505,7 @@ private:
504505
/**
505506
* Cache used by prim_match().
506507
*/
507-
std::shared_ptr<RegexCache> regexCache;
508+
const ref<RegexCache> regexCache;
508509

509510
public:
510511

src/libexpr/primops.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4611,9 +4611,9 @@ struct RegexCache
46114611
}
46124612
};
46134613

4614-
std::shared_ptr<RegexCache> makeRegexCache()
4614+
ref<RegexCache> makeRegexCache()
46154615
{
4616-
return std::make_shared<RegexCache>();
4616+
return make_ref<RegexCache>();
46174617
}
46184618

46194619
void prim_match(EvalState & state, const PosIdx pos, Value ** args, Value & v)

0 commit comments

Comments
 (0)