lua-users home
lua-l archive

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


*   Just an offset is not enough (may be the same in unions anyway), you
also need different metatables, which means that you'll have extra
memory allocation for the embedded userdata anyway, because you can't
fit the handle, the offset, and the metatable pointer in one TValue.

Offset is only an option,  an enum (32bit int) would be better. We can use the same metatable, and use the enum to dispatch the different cases.