From bb283f4581ac07a4dd75325c4343d7f28b1ff376 Mon Sep 17 00:00:00 2001
From: Andy Belle-Isle <drumsetmonkey@gmail.com>
Date: Sun, 25 Aug 2019 16:39:02 -0400
Subject: Fixed LuaJIT files

---
 lib/LuaJIT/src/lj_udata.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 lib/LuaJIT/src/lj_udata.c

(limited to 'lib/LuaJIT/src/lj_udata.c')

diff --git a/lib/LuaJIT/src/lj_udata.c b/lib/LuaJIT/src/lj_udata.c
new file mode 100644
index 0000000..bd0321b
--- /dev/null
+++ b/lib/LuaJIT/src/lj_udata.c
@@ -0,0 +1,34 @@
+/*
+** Userdata handling.
+** Copyright (C) 2005-2017 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));
+}
+
-- 
cgit v1.2.3