I'm starting at LUAJIT.
LUAJIT has a function to set mode
LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode);
Is there any way to get actual mode ?
Thanks
I'm not sure that you can do that, and I'm not sure if this is an option for you, but you could edit src/lj_dispatch.c
, and add (untested):
int luaJIT_getmode(lua_State *L, int idx) {
global_State *g = G(L);
return G2J(g)->flags;
}
and you would add a definition into luajit.h
. I don't think this is very pragmatic, but in the spirit of const_cast
I see no reason for it not to work. Suggest avoiding the need to do this though...