1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

Hide FunctionCallTrace constructor/destructor

This prevents them from being inlined. On gcc 9, this reduces the
stack size needed for

  nix-instantiate '<nixpkgs>' -A texlive.combined.scheme-full --dry-run

from 12.9 MiB to 4.8 MiB.

(cherry picked from commit cb90e382b5)
This commit is contained in:
Eelco Dolstra 2020-01-05 16:21:34 +01:00
parent c94fd5f51a
commit f84c3f9d65
3 changed files with 20 additions and 15 deletions

View file

@ -1096,9 +1096,7 @@ void EvalState::callPrimOp(Value & fun, Value & arg, Value & v, const Pos & pos)
void EvalState::callFunction(Value & fun, Value & arg, Value & v, const Pos & pos)
{
std::unique_ptr<FunctionCallTrace> trace;
if (evalSettings.traceFunctionCalls)
trace = std::make_unique<FunctionCallTrace>(pos);
auto trace = evalSettings.traceFunctionCalls ? std::make_unique<FunctionCallTrace>(pos) : nullptr;
forceValue(fun, pos);