![]() |
Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
|
Public Types | |
| enum | Hook { preFunctionCall , postFunctionCall } |
| using | Hooks = std::bitset<numHooks> |
Public Member Functions | |
| virtual void | preFunctionCallHook (EvalState &state, const Value &v, std::span< Value *const > args, const PosIdx pos) |
| virtual void | postFunctionCallHook (EvalState &state, const Value &v, std::span< Value *const > args, const PosIdx pos) |
| Hooks | getNeededHooks () |
Static Public Attributes | |
| static constexpr std::size_t | numHooks = Hook::postFunctionCall + 1 |
Protected Member Functions | |
| void | invalidateNeededHooks () |
| virtual Hooks | getNeededHooksImpl () const |
|
inline |
Get which hooks need to be invoked for this EvalProfiler instance.
|
inlineprotectedvirtual |
Get which hooks need to be called.
This is the actual implementation which has to be defined by subclasses. Public API goes through the needsHooks, which is a non-virtual interface (NVI) which caches the return value.
|
inlineprotected |
Invalidate the cached neededHooks.
|
virtual |
Hook called on EvalState::callFunction exit. Gets called only if (getNeededHooks().test(Hook::postFunctionCall)) is true.
| state | Evaluator state. |
| v | Function being invoked. |
| args | Function arguments. |
| pos | Function position. |
Reimplemented in nix::FunctionCallTrace, and nix::MultiEvalProfiler.
|
virtual |
Hook called in the EvalState::callFunction preamble. Gets called only if (getNeededHooks().test(Hook::preFunctionCall)) is true.
| state | Evaluator state. |
| v | Function being invoked. |
| args | Function arguments. |
| pos | Function position. |
Reimplemented in nix::FunctionCallTrace, and nix::MultiEvalProfiler.