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:
parent
45a28ed36f
commit
89951cf7fb
2 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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 &);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue