Lines Matching defs:ref
523 int ref;
530 ref = (int)lua_tointeger(L, -1); /* ref = t[freelist] */
532 if (ref != 0) { /* any free element? */
533 lua_rawgeti(L, t, ref); /* remove it from list */
534 lua_rawseti(L, t, freelist); /* (t[freelist] = t[ref]) */
537 ref = (int)lua_rawlen(L, t) + 1; /* get a new reference */
538 lua_rawseti(L, t, ref);
539 return ref;
543 LUALIB_API void luaL_unref (lua_State *L, int t, int ref) {
544 if (ref >= 0) {
547 lua_rawseti(L, t, ref); /* t[ref] = t[freelist] */
548 lua_pushinteger(L, ref);
549 lua_rawseti(L, t, freelist); /* t[freelist] = ref */