13 Star 69 Fork 22

johnsonyl/cpps

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cpps_lambda_function.cpp 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
johnsonyl 提交于 2021-01-18 01:13 +08:00 . 2021-01-18 更新
#include "cpps/cpps.h"
namespace cpps {
void cpps_reglambdafunction(C* c)
{
cpps::_module(c)[
_class<cpps_lambda_function>("CPPS_LAMBDA_FUNCTION")
];
}
cpps_lambda_function::cpps_lambda_function()
{
c = NULL;
stacklist = NULL;
realfunc = NULL;
}
cpps_lambda_function::~cpps_lambda_function()
{
if (stacklist) {
for (auto no : *(stacklist))
{
if (no && no->closeure) {
no->closeureusecount--;
if (no->closeureusecount == 0) {
cpps_gc_remove_barrier(c, no);
CPPSDELETE( no);
}
}
}
stacklist->clear();
}
}
void cpps_lambda_function::setrealfunc(cpps_cppsfunction* func)
{
realfunc = func;
}
void cpps_lambda_function::callfunction(C* c, cpps_value* ret, cpps_domain* domain, cpps_std_vector* o, cpps_stack* stack /*= NULL*/, std::vector< cpps_regvar*>* lambdastacklist /*= NULL*/)
{
realfunc->callfunction(c, ret, domain, o, stack, stacklist);
}
std::string cpps_lambda_function::getfuncname()
{
return realfunc->getfuncname();
}
bool cpps_lambda_function::getIsNeedC()
{
return realfunc->getIsNeedC();
}
cpps::int8 cpps_lambda_function::getparamcount()
{
return realfunc->getparamcount();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/cppscript/cpps.git
git@gitee.com:cppscript/cpps.git
cppscript
cpps
cpps
master

搜索帮助