From f84c3f9d65c0170fa6955b8a7fff38d8c006d6cf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 5 Jan 2020 16:21:34 +0100 Subject: Hide FunctionCallTrace constructor/destructor This prevents them from being inlined. On gcc 9, this reduces the stack size needed for nix-instantiate '' -A texlive.combined.scheme-full --dry-run from 12.9 MiB to 4.8 MiB. (cherry picked from commit cb90e382b5b6e177ea902b3909fd1897643ae3cd) --- src/libexpr/eval.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libexpr/eval.cc') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index dc2520229381..330f0191a284 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -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 trace; - if (evalSettings.traceFunctionCalls) - trace = std::make_unique(pos); + auto trace = evalSettings.traceFunctionCalls ? std::make_unique(pos) : nullptr; forceValue(fun, pos); -- cgit 1.4.1