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 lua_tolstring returns a pointer to the data inside the value sitting on the Lua stack. You need to make a copy of it then, as it can be garbage collected as soon as the value is removed from the stack for whatever reason.