In which case is it necessary to clear memory from the C side, and in which case is it not?
Do I understand correctly that:
Sample 1:
JsExt_SomeFunction: function () {
let value = "value";
return stringToUTF8OnStack(value);
},
static int SomeFunction(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 1);
const char* value = JsExt_SomeFunction();
lua_pushstring(L, value);
// free((void*)value); no cleaning required???
return 1;
}
Sample 2:
JsExt_SomeFunction: function () {
let value = "value";
return stringToUTF8(value);
},
static int SomeFunction(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 1);
const char* value = JsExt_SomeFunction();
lua_pushstring(L, value);
free((void*)value); //cleaning required???
return 1;
}
Where can I read more about all these things, plus about makeDynCall?