add lua user types + bytearray

This commit is contained in:
MihailRis
2024-06-16 20:15:26 +03:00
parent 0338fe542b
commit 490727fdc0
5 changed files with 186 additions and 10 deletions
+9
View File
@@ -9,6 +9,15 @@ using namespace lua;
static int nextEnvironment = 1;
std::unordered_map<std::type_index, std::string> lua::usertypeNames;
int lua::userdata_destructor(lua::State* L) {
if (auto obj = touserdata<Userdata>(L, 1)) {
obj->~Userdata();
}
return 0;
}
std::string lua::env_name(int env) {
return "_ENV"+util::mangleid(env);
}