2021-12-10 22:05:05 +00:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
// This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "lobject.h"
|
|
|
|
|
2022-08-04 23:35:33 +01:00
|
|
|
// special tag value is used for user data with inline dtors
|
2021-12-10 22:05:05 +00:00
|
|
|
#define UTAG_IDTOR LUA_UTAG_LIMIT
|
|
|
|
|
2022-08-04 23:35:33 +01:00
|
|
|
// special tag value is used for newproxy-created user data (all other user data objects are host-exposed)
|
2022-03-18 00:46:04 +00:00
|
|
|
#define UTAG_PROXY (LUA_UTAG_LIMIT + 1)
|
|
|
|
|
2021-12-10 22:05:05 +00:00
|
|
|
#define sizeudata(len) (offsetof(Udata, data) + len)
|
|
|
|
|
|
|
|
LUAI_FUNC Udata* luaU_newudata(lua_State* L, size_t s, int tag);
|
2022-01-21 17:00:19 +00:00
|
|
|
LUAI_FUNC void luaU_freeudata(lua_State* L, Udata* u, struct lua_Page* page);
|