lua-users home
lua-l archive

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


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.