mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
clarifying comments, interface tightening
This commit is contained in:
parent
1505fd4aa1
commit
c0f3403714
5 changed files with 8 additions and 2 deletions
|
@ -608,6 +608,9 @@ FuncPtr ScriptFunc::DoClone()
|
|||
{
|
||||
// ScriptFunc could hold a closure. In this case a clone of it must
|
||||
// store a copy of this closure.
|
||||
//
|
||||
// We don't use make_intrusive<> directly because we're accessing
|
||||
// a protected constructor.
|
||||
auto other = IntrusivePtr{AdoptRef{}, new ScriptFunc()};
|
||||
|
||||
CopyStateInto(other.get());
|
||||
|
|
|
@ -273,6 +273,7 @@ protected:
|
|||
/**
|
||||
* Uses the given frame for captures, and generates the
|
||||
* mapping from captured variables to offsets in the frame.
|
||||
* Virtual so it can be modified for script optimization uses.
|
||||
*
|
||||
* @param f the frame holding the values of capture variables
|
||||
*/
|
||||
|
|
|
@ -81,6 +81,8 @@ public:
|
|||
// 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++).
|
||||
//
|
||||
// Lookup() returned value must be Ref()'d if you want to hang onto it.
|
||||
bool Cache(const void* obj, Val* val);
|
||||
Val* Lookup(const void* obj);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ extern void add_global(const IDPtr& id, TypePtr t, InitClass c, ExprPtr init,
|
|||
extern StmtPtr add_local(IDPtr id, TypePtr t, InitClass c, ExprPtr init,
|
||||
std::unique_ptr<std::vector<AttrPtr>> attr, DeclType dt);
|
||||
|
||||
extern ExprPtr add_and_assign_local(IDPtr id, ExprPtr init, ValPtr val = nullptr);
|
||||
extern ExprPtr add_and_assign_local(IDPtr id, ExprPtr init, ValPtr val);
|
||||
|
||||
extern void add_type(ID* id, TypePtr t, std::unique_ptr<std::vector<AttrPtr>> attr);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
# The Gen-ZAM utility processes this file to generate numerous C++ inclusion
|
||||
# files that are then compiled into Zeek. These files span the range of (1)
|
||||
# hooks that enable run-time generation of ZAM code to execute ASTs (which
|
||||
# have first been transformed to "reduced" form, (2) specifications of the
|
||||
# have first been transformed to "reduced" form), (2) specifications of the
|
||||
# properties of the different instructions, (3) code to evaluate (execute)
|
||||
# each instruction, and (4) macros (C++ #define's) to aid in writing that
|
||||
# code. See Gen-ZAM.h for a list of the different inclusion files.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue