|
If you create the byte data in the same block as the object, with int len = luaL_checkinteger(L, 1); TByteList *obj = (TByteList*) lua_newuserdata(L, sizeof(TByteList)+len); obj->len = len; obj->data = ((char *) obj)+sizeof(TByteList); then you don't need a gc method.