Barracuda Application Server C/C++ Reference
NO
|
Functions designed to be similar to using luaL_ref(L, LUA_REGISTRYINDEX), lua_rawgeti(L, LUA_REGISTRYINDEX, ix), and luaL_unref(L, LUA_REGISTRYINDEX, ix), but with weak references.
Weak references allow the Lua garbage collector to collect values even if they are still referenced in the weak table.
Functions | |
BA_API int | balua_wkRef (lua_State *L) |
Creates and returns a reference in the weak table, for the object on the top of the stack (and pops the object). More... | |
BA_API void | balua_wkPush (lua_State *L, int reference) |
Pushes the value associated with the key 'index' on top of the stack. More... | |
BA_API void | balua_wkUnref (lua_State *L, int reference) |
Releases the reference ref from the weak table. More... | |
BA_API void balua_wkPush | ( | lua_State * | L, |
int | reference | ||
) |
Pushes the value associated with the key 'index' on top of the stack.
Pushes null if reference is not found.
L | the state |
reference | the reference returned by balua_wkRef |
BA_API int balua_wkRef | ( | lua_State * | L | ) |
Creates and returns a reference in the weak table, for the object on the top of the stack (and pops the object).
L | the state |
BA_API void balua_wkUnref | ( | lua_State * | L, |
int | reference | ||
) |
Releases the reference ref from the weak table.
L | the state |
reference | the reference returned by balua_wkRef |