introduced notion of light-weight Frame clones

This commit is contained in:
Vern Paxson 2023-04-02 11:35:15 -07:00
parent 0c434ca4f8
commit 4af6b52876
2 changed files with 19 additions and 0 deletions

View file

@ -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 )

View file

@ -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:
*