diff --git a/src/Func.h b/src/Func.h index f6808484d5..d22a8cc716 100644 --- a/src/Func.h +++ b/src/Func.h @@ -211,6 +211,15 @@ public: return *captures_vec; } + /** + * Set the set of ZVal's used for captures. + * + * Used for script optimization purposes. + * + * @param cv The value used for captures_vec. + */ + void SetCapturesVec(std::unique_ptr> cv) { captures_vec = std::move(cv); } + // Same definition as in Frame.h. using OffsetMap = std::unordered_map; @@ -291,9 +300,6 @@ protected: */ virtual void SetCaptures(Frame* f); - // Captures when using ZVal block instead of a Frame. - std::unique_ptr> captures_vec; - private: size_t frame_size = 0; @@ -307,6 +313,9 @@ private: OffsetMap* captures_offset_mapping = nullptr; + // Captures when using ZVal block instead of a Frame. + std::unique_ptr> captures_vec; + // The most recently added/updated body ... StmtPtr current_body; diff --git a/src/script_opt/CPP/Func.h b/src/script_opt/CPP/Func.h index 9a12cb2921..4642c2fdaa 100644 --- a/src/script_opt/CPP/Func.h +++ b/src/script_opt/CPP/Func.h @@ -77,7 +77,6 @@ protected: // Methods related to sending lambdas via Broker. std::optional SerializeCaptures() const override; void SetCaptures(Frame* f) override; - void SetCapturesVec(std::unique_ptr> _captures_vec) { captures_vec = std::move(_captures_vec); } FuncPtr DoClone() override;