MINOR: hlua: add simple hlua reference handling API
We're doing this in an attempt to simplify temporary lua objects
references handling.
Adding the new hlua_unref() function to release lua object references
created using luaL_ref(, LUA_REGISTRYINDEX)
(ie: hlua_checkfunction() and hlua_checktable())
Failure to release unused object reference prevents the reference index
from being re-used and prevents the referred ressource from being garbage
collected.
Adding hlua_pushref(L, ref) to replace
lua_rawgeti(L, LUA_REGISTRYINDEX, ref)
Adding hlua_ref(L) to replace luaL_ref(L, LUA_REGISTRYINDEX)
(cherry picked from commit f8f8a2b872d10bb5fdedf2c92aed3013649e0e19)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 2cb079d22d958b0274a4fdb4decc14b2cc765957)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 1ad80d0e6e9915bec9c750f078509ec8cf29f9e8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0fa926aedeff11dc35c0f31051f868697da2566f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed