Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/VM/src/lfunc.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
#define sizeCclosure(n) (offsetof(Closure, c.upvals) + sizeof(TValue) * (n))
8
#define sizeLclosure(n) (offsetof(Closure, l.uprefs) + sizeof(TValue) * (n))
9
10
LUAI_FUNC Proto* luaF_newproto(lua_State* L);
11
LUAI_FUNC Closure* luaF_newLclosure(lua_State* L, int nelems, LuaTable* e, Proto* p);
12
LUAI_FUNC Closure* luaF_newCclosure(lua_State* L, int nelems, LuaTable* e);
13
LUAI_FUNC UpVal* luaF_findupval(lua_State* L, StkId level);
14
LUAI_FUNC void luaF_close(lua_State* L, StkId level);
15
LUAI_FUNC void luaF_closeupval(lua_State* L, UpVal* uv, bool dead);
16
LUAI_FUNC void luaF_freeproto(lua_State* L, Proto* f, struct lua_Page* page);
17
LUAI_FUNC void luaF_freeclosure(lua_State* L, Closure* c, struct lua_Page* page);
18
LUAI_FUNC void luaF_freeupval(lua_State* L, UpVal* uv, struct lua_Page* page);
19
LUAI_FUNC const LocVar* luaF_getlocal(const Proto* func, int local_number, int pc);
20
LUAI_FUNC const LocVar* luaF_findlocal(const Proto* func, int local_reg, int pc);
21
22