Removed GC checks from function calls

Function calls do not create new objects. (It may use memory with
stack reallocation, but now that is irrelevant to the GC.)
This commit is contained in:
Roberto Ierusalimschy
2022-11-24 10:20:15 -03:00
parent ec61be9a7e
commit 152b51955a
5 changed files with 10 additions and 20 deletions

5
lapi.c
View File

@@ -1286,13 +1286,14 @@ LUA_API void lua_toclose (lua_State *L, int idx) {
LUA_API void lua_concat (lua_State *L, int n) {
lua_lock(L);
api_checknelems(L, n);
if (n > 0)
if (n > 0) {
luaV_concat(L, n);
luaC_checkGC(L);
}
else { /* nothing to concatenate */
setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */
api_incr_top(L);
}
luaC_checkGC(L);
lua_unlock(L);
}