Garbage collection, tag, metatable questions #2032
Unanswered
mihaly-sisak
asked this question in
Q&A
Replies: 1 comment
-
|
Pls respond 😢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all! I am working trough porting some lua libs for luau and I have some questions I cant really find an answer for. Is there some documentation detailing every function in
lua.handlualib.h?Garbage collection
Why is there difference in the function signatures for tagged and untagged data? Are there performance differences between the two? Can I access the full lua state without restrictions if I use the tag one?
Tags
Can I check what tags are in use? If I want to use 2-3 libraries, do I need to coordinate between them to do not use the same tag twice?
What are these functions good for? Does it tag the top of the stack? If I set a destructor for the tag will it get called for the lightuserdata pointer created with
lua_pushlightuserdatatagged?Metatables
What does
LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname);do? How it is different than justlua_newtable? How does Lua know what it will be a metatable for if I do not need to provide a tag?Where does
LUA_API void lua_setuserdatametatable(lua_State* L, int tag);get the metatable from? Top of the stack?Am I supposed to
luaL_newmetatablethenlua_setuserdatametatable? How do I fill it? Just like a normal lua table on top of the stack?If I do not create an object with
lua_newuserdatataggedwithmetatablebut withlua_newuserdatataggedbut that tag has a metatable set, what happens? Will the object get the metatable?Beta Was this translation helpful? Give feedback.
All reactions