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.)
This commit is contained in:
Roberto Ierusalimschy
2021-09-15 11:18:41 -03:00
parent 9db4bfed6b
commit 2ff3471722
5 changed files with 32 additions and 15 deletions

View File

@@ -165,6 +165,20 @@ typedef LUAI_UACINT l_uacInt;
#endif
/*
** Inline functions
*/
#if !defined(LUA_USE_C89)
#define l_inline inline
#elif defined(__GNUC__)
#define l_inline __inline__
#else
#define l_inline /* empty */
#endif
#define l_sinline static l_inline
/*
** type for virtual-machine instructions;
** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)