Sha256: b6bfe281348d953c718a018debc5258bd8c8253037602f7b9673f41d0b081dd3

Contents?: true

Size: 848 Bytes

Versions: 24

Compression:

Stored size: 848 Bytes

Contents

/*
** Userdata handling.
** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
*/

#define lj_udata_c
#define LUA_CORE

#include "lj_obj.h"
#include "lj_gc.h"
#include "lj_udata.h"

GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env)
{
  GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata);
  global_State *g = G(L);
  newwhite(g, ud);  /* Not finalized. */
  ud->gct = ~LJ_TUDATA;
  ud->udtype = UDTYPE_USERDATA;
  ud->len = sz;
  /* NOBARRIER: The GCudata is new (marked white). */
  setgcrefnull(ud->metatable);
  setgcref(ud->env, obj2gco(env));
  /* Chain to userdata list (after main thread). */
  setgcrefr(ud->nextgc, mainthread(g)->nextgc);
  setgcref(mainthread(g)->nextgc, obj2gco(ud));
  return ud;
}

void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud)
{
  lj_mem_free(g, ud, sizeudata(ud));
}

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
immunio-1.1.2 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.1.1 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.1.0 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.22 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.19 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.17 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.15 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.14 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.13 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.12 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.11 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.10 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.9 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.8 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.7 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.6 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.5 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.4 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.3 lua-hooks/ext/luajit/src/lj_udata.c
immunio-1.0.2 lua-hooks/ext/luajit/src/lj_udata.c