From 152b51955aabb9dfb32302569fac810e999eda03 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 24 Nov 2022 10:20:15 -0300 Subject: 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.) --- lapi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 3876956d..00bdd37a 100644 --- a/lapi.c +++ b/lapi.c @@ -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); } -- cgit v1.2.3-55-g6feb