mirror of
https://github.com/NixOS/nix
synced 2025-06-26 07:31:15 +02: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.
This commit is contained in:
parent
0de33cc81b
commit
cb90e382b5
3 changed files with 20 additions and 15 deletions
|
@ -9,17 +9,7 @@ namespace nix {
|
|||
struct FunctionCallTrace
|
||||
{
|
||||
const Pos & pos;
|
||||
|
||||
FunctionCallTrace(const Pos & pos) : pos(pos) {
|
||||
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
|
||||
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);
|
||||
printMsg(lvlInfo, "function-trace entered %1% at %2%", pos, ns.count());
|
||||
}
|
||||
|
||||
~FunctionCallTrace() {
|
||||
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
|
||||
auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(duration);
|
||||
printMsg(lvlInfo, "function-trace exited %1% at %2%", pos, ns.count());
|
||||
}
|
||||
FunctionCallTrace(const Pos & pos);
|
||||
~FunctionCallTrace();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue