mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
introduced notion of light-weight Frame clones
This commit is contained in:
parent
0c434ca4f8
commit
4af6b52876
2 changed files with 19 additions and 0 deletions
11
src/Frame.cc
11
src/Frame.cc
|
@ -120,6 +120,17 @@ Frame* Frame::Clone() const
|
|||
return other;
|
||||
}
|
||||
|
||||
Frame* Frame::LightClone() const
|
||||
{
|
||||
Frame* other = new Frame(0, function, func_args);
|
||||
|
||||
other->call = call;
|
||||
other->assoc = assoc;
|
||||
other->trigger = trigger;
|
||||
|
||||
return other;
|
||||
}
|
||||
|
||||
static bool val_is_func(const ValPtr& v, ScriptFunc* func)
|
||||
{
|
||||
if ( v->GetType()->Tag() != TYPE_FUNC )
|
||||
|
|
|
@ -157,6 +157,14 @@ public:
|
|||
*/
|
||||
Frame* Clone() const;
|
||||
|
||||
/**
|
||||
* Creates a copy of the frame that doesn't include its values,
|
||||
* just its trigger context.
|
||||
*
|
||||
* @return a partial copy of this frame.
|
||||
*/
|
||||
Frame* LightClone() const;
|
||||
|
||||
/**
|
||||
* Serializes the frame in support of copy semantics for lambdas:
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue