** Simulate a garbage colection. When string table or array table overflows, ** this function check if all allocated strings and arrays are in use. If ** there are unused ones, pack (compress) the tables. */ static void lua_pack (void) { lua_markstack (); lua_marktable (); { /...
lua_createtable(L, 0, 0) // 新建并压入一个表 lua_pushnumber(L, 343) // 压入一个数字 lua_pushstring(L, “mystr”) // 压入一个字符串 存入栈的数据类型包括数值, 字符串, 指针, talbe, 闭包等。 压入的值在C看来是不同类型的,在lua看来都是TValue结构。 typedefstructlua_TValue{ Valu...
** 调用luaH_newkey,在table上寻找可以设置key的node节点,设置成功后,返回Node->i_val ** node节点k=v形式 */ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { const TValue *p = luaH_get(t, key); if (p != luaO_nilobject) return cast(TValue *, p); else retur...
这个expdesc的含义是,因为e->k为VINDEXED,所以这是一个从一个table取值的处理,而且e->u.ind.vt为VUPVAL,所以这个被操作的表,要去upvalue表去查找,又因为e->u.ind.t为0,所以操作目标是UpValue[0],最后idx为258,则是去常量表里找到访问table的key值。 我们在获得了expdesc结构以后,最终是要将这些信息转化为...
栈是FILO(先进后出)的。栈中每个元素为一个TValue类型。64位系统下,sizeof(TValue)=16,sizeof(Value)=8 其中boolean(布尔)、integer(整型)、double(浮点)、light userdata、light c function是直接存在栈上的 TString、Udata、Closure、Table、lua state在栈上只是一个指针,都为GC类型,当没有被引用时会被lua...
// lj_obj.h#define tvisint(o) (LJ_DUALNUM && itype(o) == LJ_TISNUM)#define intV(o) check_exp(tvisint(o), (int32_t)(o)->i)#define setitype(o, i) ((o)->it = ((i) << 15))staticLJ_AINLINEvoidsetintV(TValue*o,int32_ti){#if LJ_DUALNUMo->i=(uint32_t)i;set...
If any of the composing value is a valid redis error value, then it will be a two element table {false, err}.A nil multi-bulk reply returns in a ngx.null value.See http://redis.io/topics/protocol for details regarding various Redis reply types....
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
constTValue*luaH_getnum(Table*t,intkey){/* (1 <= key && key <= t->sizearray) */if(cast(unsignedint,key-1)<cast(unsignedint,t->sizearray))return&t->array[key-1];else{lua_Number nk=cast_num(key);Node*n=hashnum(t,nk);do{/* check whether `key' is somewhere in the chain...
returnfalseendif#self.department_whitelist ==0thenreturntrueendlocaldepartment_ids = user["department_ids"]ifnotdepartment_idsordepartment_ids ==""thenreturnfalseendiftype(department_ids) ~="table"thendepartment_ids = json.decode(department_ids)endfori=1, #department_idsdoifhas_value(self.department_...