mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
switch cached Trigger values to be opaque-and-generic, rather than assuming CallExpr's
This commit is contained in:
parent
9ada7ac4e7
commit
5eb37e4c78
9 changed files with 50 additions and 40 deletions
|
@ -25,7 +25,6 @@ namespace detail
|
|||
class Frame;
|
||||
class Stmt;
|
||||
class Expr;
|
||||
class CallExpr;
|
||||
class ID;
|
||||
class WhenInfo;
|
||||
|
||||
|
@ -86,9 +85,11 @@ public:
|
|||
|
||||
// Cache for return values of delayed function calls. Returns whether
|
||||
// the trigger is queued for later evaluation -- it may not be queued
|
||||
// if the Val is null or it's disabled.
|
||||
bool Cache(const CallExpr* expr, Val* val);
|
||||
Val* Lookup(const CallExpr*);
|
||||
// if the Val is null or it's disabled. The cache is managed using
|
||||
// void*'s so that the value can be associated with either a CallExpr
|
||||
// (for interpreted execution) or a C++ function (for compiled-to-C++).
|
||||
bool Cache(const void* obj, Val* val);
|
||||
Val* Lookup(const void*);
|
||||
|
||||
// Disable this trigger completely. Needed because Unref'ing the trigger
|
||||
// may not immediately delete it as other references may still exist.
|
||||
|
@ -153,7 +154,7 @@ private:
|
|||
|
||||
std::vector<std::pair<Obj*, notifier::detail::Modifiable*>> objs;
|
||||
|
||||
using ValCache = std::map<const CallExpr*, Val*>;
|
||||
using ValCache = std::map<const void*, Val*>;
|
||||
ValCache cache;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue