1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 01:09:37 +01:00

Extract a Value method to set the eval cache

This commit is contained in:
regnat 2021-06-03 10:52:43 +02:00
parent 45a28ed36f
commit 89951cf7fb
2 changed files with 8 additions and 0 deletions

View file

@ -1813,6 +1813,13 @@ ValueCache & Value::getEvalCache()
ValueCache ValueCache::empty = ValueCache(nullptr); ValueCache ValueCache::empty = ValueCache(nullptr);
void Value::setEvalCache(ValueCache & newCache)
{
if (internalType == tAttrs) {
attrs->eval_cache = newCache;
}
}
string EvalState::forceString(Value & v, PathSet & context, const Pos & pos) string EvalState::forceString(Value & v, PathSet & context, const Pos & pos)
{ {
string s = forceString(v, pos); string s = forceString(v, pos);

View file

@ -353,6 +353,7 @@ public:
std::vector<std::pair<Path, std::string>> getContext(); std::vector<std::pair<Path, std::string>> getContext();
ValueCache & getEvalCache(); ValueCache & getEvalCache();
void setEvalCache(ValueCache &);
}; };