aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-24 10:20:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2022-11-24 10:20:15 -0300
commit152b51955aabb9dfb32302569fac810e999eda03 (patch)
tree68a5495c94326ac24023370779d231af468fbd9a /lapi.c
parentec61be9a7e828bfa366a35658b90f53b1ce39478 (diff)
downloadlua-152b51955aabb9dfb32302569fac810e999eda03.tar.gz
lua-152b51955aabb9dfb32302569fac810e999eda03.tar.bz2
lua-152b51955aabb9dfb32302569fac810e999eda03.zip
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.)
Diffstat (limited to '')
-rw-r--r--lapi.c5
1 files changed, 3 insertions, 2 deletions
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) {
1286LUA_API void lua_concat (lua_State *L, int n) { 1286LUA_API void lua_concat (lua_State *L, int n) {
1287 lua_lock(L); 1287 lua_lock(L);
1288 api_checknelems(L, n); 1288 api_checknelems(L, n);
1289 if (n > 0) 1289 if (n > 0) {
1290 luaV_concat(L, n); 1290 luaV_concat(L, n);
1291 luaC_checkGC(L);
1292 }
1291 else { /* nothing to concatenate */ 1293 else { /* nothing to concatenate */
1292 setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ 1294 setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */
1293 api_incr_top(L); 1295 api_incr_top(L);
1294 } 1296 }
1295 luaC_checkGC(L);
1296 lua_unlock(L); 1297 lua_unlock(L);
1297} 1298}
1298 1299