experimental optimize canvas:set_data using ffi

This commit is contained in:
MihailRis
2025-03-08 18:04:10 +03:00
parent 6078a8802e
commit e48216da40
6 changed files with 61 additions and 13 deletions
+5 -1
View File
@@ -25,7 +25,8 @@ namespace lua {
if (n < 0) {
abort();
}
if (lua_gettop(L) < n) {
int top = lua_gettop(L);
if (top < n) {
abort();
}
#endif
@@ -63,6 +64,9 @@ namespace lua {
inline void rawseti(lua::State* L, int n, int idx = -2) {
lua_rawseti(L, idx, n);
}
inline void rawset(lua::State* L, int idx = -3) {
lua_rawset(L, idx);
}
inline int createtable(lua::State* L, int narr, int nrec) {
lua_createtable(L, narr, nrec);