1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 13:36:02 +01:00

libexpr: Clear PosTable contents in EvalState::resetFileCache

Otherwise PosTable grows indefinitely for each reload. Since
the total input size is limited to 4GB (uint32_t for byte offset PosIdx)
it can get exhausted pretty. This ensures that we don't waste memory
on reloads as well.
This commit is contained in:
Sergei Zimmerman 2025-11-09 22:09:18 +03:00
parent 479b6b73a9
commit a091a8100a
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -1113,6 +1113,7 @@ void EvalState::resetFileCache()
importResolutionCache->clear();
fileEvalCache->clear();
inputCache->clear();
positions.clear();
}
void EvalState::eval(Expr * e, Value & v)