lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Em sex., 4 de dez. de 2020 às 03:11, Vadim Peretokin <vperetokin@gmail.com> escreveu:
 Would 64bit Windows really be that different that it's exposing a flaw?
long = 4 bytes?

I managed to manage the resolution between Lua locals and C callbacks.
luaL_ref and __len metamethod using userdata.
__len metamethod seems to me to be the key.

static int myuserdata_size(lua_State *L) {
luaL_checkudata(L, 1, MYUSERDATA_REGISTRY);
lua_pushinteger(L, sizeof(struct MyUserData));
return 1;
}

regards,
Ranier Vilela