MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / CppiaClosure

Method CppiaClosure

src/hx/cppia/CppiaFunction.cpp:697–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695 ScriptCallable *function;
696
697 CppiaClosure(CppiaCtx *ctx, ScriptCallable *inFunction)
698 {
699 function = inFunction;
700
701 unsigned char *base = ((unsigned char *)this) + sizeof(CppiaClosure);
702
703 *(hx::Object **)base = ctx->getThis(false);
704
705 for(int i=0;i<function->captureVars.size();i++)
706 {
707 CppiaStackVar *var = function->captureVars[i];
708 int size = sTypeSize[var->expressionType];
709 memcpy( base+var->capturePos, ctx->frame + var->fromStackPos, size );
710 }
711 }
712
713 hx::Object **getThis() const
714 {

Callers

nothing calls this directly

Calls 3

memcpyFunction · 0.85
getThisMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected