aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-09-15 11:18:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-09-15 11:18:41 -0300
commit2ff34717227b8046b0fdcb96206f11f5e888664e (patch)
tree112f054406eaa82363716882b4300d4ff98ab2ef /ldo.c
parent9db4bfed6bb9d5828c99c0f24749eedf54d70cc2 (diff)
downloadlua-2ff34717227b8046b0fdcb96206f11f5e888664e.tar.gz
lua-2ff34717227b8046b0fdcb96206f11f5e888664e.tar.bz2
lua-2ff34717227b8046b0fdcb96206f11f5e888664e.zip
Using 'inline' in some functions
According to ISO C, "making a function an inline function suggests that calls to the function be as fast as possible." (Not available in C89.)
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ldo.c b/ldo.c
index 889cb34b..88b20f95 100644
--- a/ldo.c
+++ b/ldo.c
@@ -407,7 +407,7 @@ StkId luaD_tryfuncTM (lua_State *L, StkId func) {
407** expressions, multiple results for tail calls/single parameters) 407** expressions, multiple results for tail calls/single parameters)
408** separated. 408** separated.
409*/ 409*/
410static void moveresults (lua_State *L, StkId res, int nres, int wanted) { 410l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) {
411 StkId firstresult; 411 StkId firstresult;
412 int i; 412 int i;
413 switch (wanted) { /* handle typical cases separately */ 413 switch (wanted) { /* handle typical cases separately */
@@ -499,8 +499,8 @@ void luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1) {
499} 499}
500 500
501 501
502static CallInfo *prepCallInfo (lua_State *L, StkId func, int nret, 502l_sinline CallInfo *prepCallInfo (lua_State *L, StkId func, int nret,
503 int mask, StkId top) { 503 int mask, StkId top) {
504 CallInfo *ci = L->ci = next_ci(L); /* new frame */ 504 CallInfo *ci = L->ci = next_ci(L); /* new frame */
505 ci->func = func; 505 ci->func = func;
506 ci->nresults = nret; 506 ci->nresults = nret;
@@ -572,7 +572,7 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) {
572** number of recursive invocations in the C stack) or nyci (the same 572** number of recursive invocations in the C stack) or nyci (the same
573** plus increment number of non-yieldable calls). 573** plus increment number of non-yieldable calls).
574*/ 574*/
575static void ccall (lua_State *L, StkId func, int nResults, int inc) { 575l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) {
576 CallInfo *ci; 576 CallInfo *ci;
577 L->nCcalls += inc; 577 L->nCcalls += inc;
578 if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) 578 if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS))