anyone with experience with the lua c api: how does the garbage collection of strings passed from lua to c work? how do you ensure the lua gc does not free the string while c is using it?
@nasser afaik lua_pushstring makes a copy of the string and never keeps any C pointers
@nasser oh sorry you said from Lua to C. I think the pointer you get from luaL_checkstring is valid only while that stack index is unmodified
@nasser basically if you want to access that string anywhere outside of the C function being called by Lua, make a copy of it.
this is where the cool kids live