diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-24 10:20:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-11-24 10:20:15 -0300 |
commit | 152b51955aabb9dfb32302569fac810e999eda03 (patch) | |
tree | 68a5495c94326ac24023370779d231af468fbd9a /lapi.c | |
parent | ec61be9a7e828bfa366a35658b90f53b1ce39478 (diff) | |
download | lua-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1286,13 +1286,14 @@ LUA_API void lua_toclose (lua_State *L, int idx) { | |||
1286 | LUA_API void lua_concat (lua_State *L, int n) { | 1286 | LUA_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 | ||