mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 11:03:12 +00:00
* update to lua 5.4.0-rc1 * remove LUA_ERRGCMM * use age bits for shared * remove unused lbitlib.c * use luaV_fastget * fix #1174 * suspend函数tailcall优化 * 防止没有session导致未调用suspend * luaH_setint check shared (#1184) * set LUA_GCGEN by default * fix #1174 (#1186) checkshared in sweeplist * update to lua 5.4 rc2 * update to lua 5.4 rc4 * move skynet.profile into snlua * Use lua_sethook to interrupt tight loops * remove lua_checksig * critical condition for signals * update to lua 5.4 released * lua 5.4 bugfix * update lua bugfix * fix lua_sharestring (#1224) * update lua * update lua 5.4 * update README * add skynet.select * add test * test error & discard * yield session * request error has no error message * add timeout to skynet.select * bugfix * for lua 5.4 * new version * bugfix * bugfix * use if instead of while * make local * yield in select for * update lua 5.4.1 * change lua version (#1245) Co-authored-by: xiaojin <xiaojin@onemt.com.cn> * update lua version number Co-authored-by: hong <hongling0@gmail.com> Co-authored-by: hong <hongling-0@qq.com> Co-authored-by: 风---自由 <996442717qqcom@gmail.com> Co-authored-by: xiaojin <xiaojin@onemt.com.cn>
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
/*
|
|
** $Id: lapi.h $
|
|
** Auxiliary functions from Lua API
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#ifndef lapi_h
|
|
#define lapi_h
|
|
|
|
|
|
#include "llimits.h"
|
|
#include "lstate.h"
|
|
|
|
|
|
/* Increments 'L->top', checking for stack overflows */
|
|
#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
|
|
"stack overflow");}
|
|
|
|
|
|
/*
|
|
** If a call returns too many multiple returns, the callee may not have
|
|
** stack space to accommodate all results. In this case, this macro
|
|
** increases its stack space ('L->ci->top').
|
|
*/
|
|
#define adjustresults(L,nres) \
|
|
{ if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
|
|
|
|
|
|
/* Ensure the stack has at least 'n' elements */
|
|
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
|
|
"not enough elements in the stack")
|
|
|
|
|
|
/*
|
|
** To reduce the overhead of returning from C functions, the presence of
|
|
** to-be-closed variables in these functions is coded in the CallInfo's
|
|
** field 'nresults', in a way that functions with no to-be-closed variables
|
|
** with zero, one, or "all" wanted results have no overhead. Functions
|
|
** with other number of wanted results, as well as functions with
|
|
** variables to be closed, have an extra check.
|
|
*/
|
|
|
|
#define hastocloseCfunc(n) ((n) < LUA_MULTRET)
|
|
|
|
#define codeNresults(n) (-(n) - 3)
|
|
|
|
#endif
|