My application is able to push a function in a Todo list by using a code like : function test() print("coucou") end
todo:pushtask( test ) -- First push
todo:pushtask( test ) -- Second push
Internally, the todo list is a C table of integer where I push a reference to the passed function took from :
int func = luaL_ref(L, LUA_REGISTRYINDEX);
But how can I detect if I'm pushing the same function ? As per my test, luaL_ref returning do different references even if the same function is pushed (let's say ref #1 and #2) How can I check if #1 and #2 are references to the same function ?
Thanks
Laurent