Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/VM/src/ludata.h
2725 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
// This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3
#pragma once
4
5
#include "lobject.h"
6
7
// special tag value is used for user data with inline dtors
8
#define UTAG_IDTOR LUA_UTAG_LIMIT
9
10
// special tag value is used for newproxy-created user data (all other user data objects are host-exposed)
11
#define UTAG_PROXY (LUA_UTAG_LIMIT + 1)
12
13
// userdata larger than 16 bytes will be extended to guarantee 16 byte alignment of subsequent blocks
14
#define sizeudata(len) (offsetof(Udata, data) + (len > 16 ? ((len + 15) & ~15) : len))
15
16
LUAI_FUNC Udata* luaU_newudata(lua_State* L, size_t s, int tag);
17
LUAI_FUNC void luaU_freeudata(lua_State* L, Udata* u, struct lua_Page* page);
18
19