static StkId callCclosure (struct Closure *cl, lua_CFunction f, StkId base) { TObject *pbase; int nup = cl->nelems; /* number of upvalues */ luaD_checkstack(nup); pbase = L->stack.stack+base; /* care: previous call may change this */ /* open space for upvalues as extra arguments */ luaO_memup(pbase+nup, pbase, (L->stack.top-pbase)*sizeof(TObject)); /* copy upvalues into stack */ memcpy(pbase, cl->consts+1, nup*sizeof(TObject)); L->stack.top += nup; return callC(f, base); }
/* ** Open a hole below "nelems" from the L->stack.top. */ void luaD_openstack (int nelems) { luaO_memup(L->stack.top-nelems+1, L->stack.top-nelems, nelems*sizeof(TObject)); incr_top; }
/* ** Open a hole below "nelems" from the lua_state->stack.top. */ void luaD_openstack(int32 nelems) { luaO_memup(lua_state->stack.top - nelems + 1, lua_state->stack.top - nelems, nelems * sizeof(TObject)); incr_top; }