1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

symbol-table: reference entries instead of allocating Values

This commit is contained in:
Philipp Otterbein 2025-06-01 21:00:01 +02:00
parent 94bbaddb93
commit ed4e512dcd
4 changed files with 19 additions and 12 deletions

View file

@ -90,6 +90,11 @@ std::string printValue(EvalState & state, Value & v)
return out.str();
}
Value * Value::toPtr(SymbolStr str) noexcept
{
return const_cast<Value *>(str.valuePtr());
}
void Value::print(EvalState & state, std::ostream & str, PrintOptions options)
{
printValue(state, str, *this, options);
@ -919,11 +924,6 @@ void Value::mkStringMove(const char * s, const NixStringContext & context)
mkString(s, encodeContext(context));
}
void Value::mkString(const SymbolStr & s)
{
mkString(s.c_str(), nullptr);
}
void Value::mkPath(const SourcePath & path)
{
mkPath(&*path.accessor, makeImmutableString(path.path.abs()));