当前位置: 首页>>代码示例>>C++>>正文


C++ setobj2n函数代码示例

本文整理汇总了C++中setobj2n函数的典型用法代码示例。如果您正苦于以下问题:C++ setobj2n函数的具体用法?C++ setobj2n怎么用?C++ setobj2n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setobj2n函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mallocstate

lua_State *luaE_newthread (lua_State *L) {
  lua_State *L1 = mallocstate(L);
  luaC_link(L, valtogco(L1), LUA_TTHREAD);
  preinit_state(L1);
  L1->l_G = L->l_G;
  stack_init(L1, L);  /* init stack */
  setobj2n(gt(L1), gt(L));  /* share table of globals */
  return L1;
}
开发者ID:zlandau,项目名称:lua-safe,代码行数:9,代码来源:lstate.c

示例2: luaF_close

void luaF_close (lua_State *L, StkId level) {
  UpVal *p;
  while ((p = ngcotouv(L->openupval)) != NULL && p->v >= level) {
    setobj2n(&p->value, p->v);  /* save current value (write barrier) */
    p->v = &p->value;  /* now current value lives here */
    L->openupval = p->next;  /* remove from `open' list */
    luaC_link(L, valtogco(p), LUA_TUPVAL);
  }
}
开发者ID:dodong471520,项目名称:pap,代码行数:9,代码来源:lfunc.c

示例3: tostate

lua_State *luaE_newthread (lua_State *L) {
  lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
  luaC_link(L, obj2gco(L1), LUA_TTHREAD);
  preinit_state(L1, G(L));
  stack_init(L1, L);  /* init stack */
  setobj2n(L, gt(L1), gt(L));  /* share table of globals */
  L1->hookmask = L->hookmask;
  L1->basehookcount = L->basehookcount;
  L1->hook = L->hook;
  resethookcount(L1);
  lua_assert(iswhite(obj2gco(L1)));
  return L1;
}
开发者ID:Alibaba-boonya,项目名称:wax,代码行数:13,代码来源:lstate.c

示例4: lua_pushcclosure

LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
  Closure *cl;
  lua_lock(L);
  luaC_checkGC(L);
  api_checknelems(L, n);
  cl = luaF_newCclosure(L, n);
  cl->c.f = fn;
  L->top -= n;
  while (n--)
    setobj2n(&cl->c.upvalue[n], L->top+n);
  setclvalue(L->top, cl);
  api_incr_top(L);
  lua_unlock(L);
}
开发者ID:TheWaWaR,项目名称:my-lua5.0,代码行数:14,代码来源:lapi.c

示例5: tostate

lua_State *luaE_newthread (lua_State *L) {
  lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State)));
  luaC_link(L, obj2gco(L1), LUA_TTHREAD);
  setthvalue(L, L->top, L1); /* put thread on stack */
  incr_top(L);
  preinit_state(L1, G(L));
  stack_init(L1, L);  /* init stack */
  setobj2n(L, gt(L1), gt(L));  /* share table of globals */
  L1->hookmask = L->hookmask;
  L1->basehookcount = L->basehookcount;
  L1->hook = L->hook;
  resethookcount(L1);
  lua_assert(!isdead(G(L), obj2gco(L1)));
  L->top--; /* remove thread from stack */
  return L1;
}
开发者ID:cls22,项目名称:eLua-PIC32-,代码行数:16,代码来源:lstate.c

示例6: lua_pushcclosure

LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
  lua_lock(L);
  if (n == 0) {
    setfvalue(L->top, fn);
  }
  else {
    Closure *cl;
    api_checknelems(L, n);
    api_check(L, n <= MAXUPVAL, "upvalue index too large");
    luaC_checkGC(L);
    cl = luaF_newCclosure(L, n);
    cl->c.f = fn;
    L->top -= n;
    while (n--)
      setobj2n(L, &cl->c.upvalue[n], L->top + n);
    setclCvalue(L, L->top, cl);
  }
  api_incr_top(L);
  lua_unlock(L);
}
开发者ID:AdunSG,项目名称:Pktgen-DPDK,代码行数:20,代码来源:lapi.c

示例7: mallocstate

lua_State *luaE_newthread (lua_State *L) {
  lua_State *L1 = mallocstate(L);
  luaC_link(L, valtogco(L1), LUA_TTHREAD);
  preinit_state(L1);
  L1->l_G = L->l_G;
#if LUA_REFCOUNT
  L1->gclist_head.next = (GCObject*)&L->gclist_tail;
  L1->gclist_head.prev = NULL;
  L1->gclist_tail.next = NULL;
  L1->gclist_tail.prev = (GCObject*)&L->gclist_head;
  L1->gclist_head.tt = LUA_TNIL;
  L1->gclist_head.marked = 0;
  L1->gclist_head.ref = 0;
  L1->gclist_tail.tt = LUA_TNIL;
  L1->gclist_tail.marked = 0;
  L1->gclist_tail.ref = 0;
  L1->ref = 0;
#endif LUA_REFCOUNT
  stack_init(L1, L);  /* init stack */
  setobj2n(gt(L1), gt(L));  /* share table of globals */
  return L1;
}
开发者ID:dodong471520,项目名称:pap,代码行数:22,代码来源:lstate.c


注:本文中的setobj2n函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。