include/luax.h
// Initialization:
// Create lightuserdata table with weak values.
// It used to store instance pointers to reuse already pushed values.
Create lightuserdata table with weak values.
It used to store instance pointers to reuse already pushed values.
Create lightuserdata table with weak values . It used to store instance pointers to reuse already pushed values .
static void init(lua_State * L)
{
    lua_newtable(L);                            
    lua_newtable(L);                             mt
    lua_pushliteral(L, "__mode");                mt key
    lua_pushliteral(L, "v");                     mt key value
    lua_rawset(L, -3);                          
    lua_setmetatable(L, -2);                    .__mt = mt, tbl
    lua_setfield(L, LUA_REGISTRYINDEX, LUAX_UDATA); 
}
static void init ( lua_State * L ) { lua_newtable ( L ) ; lua_newtable ( L ) ; lua_pushliteral ( L , " " ) ; lua_pushliteral ( L , " " ) ; lua_rawset ( L , -3 ) ; lua_setmetatable ( L , -2 ) ; lua_setfield ( L , LUA_REGISTRYINDEX , LUAX_UDATA ) ; }
Initialization:
Create lightuserdata table with weak values.
Initialization : Create lightuserdata table with weak values .
// tbl // tbl mt // tbl mt key // tbl mt key value // mt.__mode = 'v', tbl mt // tbl.__mt = mt, tbl // registry[key] = tbl