public static Udata luaS_newudata(lua_State L, uint s, Table e) { Udata u = new Udata(); u.uv.marked = luaC_white(G(L)); /* is not finalized */ u.uv.tt = LUA_TUSERDATA; u.uv.len = s; u.uv.metatable = null; u.uv.env = e; u.user_data = new byte[s]; /* chain it on udata list (after main thread) */ u.uv.next = G(L).mainthread.next; G(L).mainthread.next = obj2gco(u); return u; }
public static Udata luaS_newudata(LuaState L, uint s, Table e) { Udata u = new Udata(); u.uv.marked = LuaCWhite(G(L)); /* is not finalized */ u.uv.tt = LUA_TUSERDATA; u.uv.len = s; u.uv.metatable = null; u.uv.env = e; u.user_data = new byte[s]; AddTotalBytes(L, GetUnmanagedSize(typeof(Udata)) + sizeudata(u)); /* chain it on udata list (after main thread) */ u.uv.next = G(L).mainthread.next; G(L).mainthread.next = obj2gco(u); return u; }
public static int sizeudata(Udata u) { return (int)u.len; }
internal static Udata luaS_newudata(lua_State L, Type t, Table e) { Udata u = new Udata(); u.uv.marked = luaC_white(G(L)); /* is not finalized */ u.uv.tt = LUA_TUSERDATA; u.uv.len = 0; u.uv.metatable = null; u.uv.env = e; u.user_data = luaM_realloc_(L, t); AddTotalBytes(L, GetUnmanagedSize(typeof(Udata))); /* chain it on udata list (after main thread) */ u.uv.next = G(L).mainthread.next; G(L).mainthread.next = obj2gco(u); return u; }
public static int sizeudata(Udata u) { return((int)u.len); }
/* ** Get the address of memory block inside 'Udata'. ** (Access to 'ttuv_' ensures that value is really a 'Udata'.) */ public static object getudatamem(Udata u) { return(u.user_data); }
public static uint sizeudata(Udata u) { return(sizeludata((u).len)); }
public static uint sizeudata(Udata u) { return(u.len); }