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>
60 lines
1.8 KiB
C
60 lines
1.8 KiB
C
/*
|
|
** $Id: lstring.h $
|
|
** String table (keep all strings handled by Lua)
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
|
|
#ifndef lstring_h
|
|
#define lstring_h
|
|
|
|
#include "lgc.h"
|
|
#include "lobject.h"
|
|
#include "lstate.h"
|
|
|
|
|
|
/*
|
|
** Memory-allocation error message must be preallocated (it cannot
|
|
** be created after memory is exhausted)
|
|
*/
|
|
#define MEMERRMSG "not enough memory"
|
|
|
|
|
|
/*
|
|
** Size of a TString: Size of the header plus space for the string
|
|
** itself (including final '\0').
|
|
*/
|
|
#define sizelstring(l) (offsetof(TString, contents) + ((l) + 1) * sizeof(char))
|
|
|
|
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
|
|
(sizeof(s)/sizeof(char))-1))
|
|
|
|
|
|
/*
|
|
** test whether a string is a reserved word
|
|
*/
|
|
#define isreserved(s) ((s)->tt == LUA_VSHRSTR && (s)->extra > 0)
|
|
|
|
|
|
/*
|
|
** equality for short strings, compare id first
|
|
*/
|
|
#define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b) || \
|
|
( ((a)->id == (b)->id) ? ((a)->id != 0) : ((a)->hash == (b)->hash && luaS_eqshrstr(a,b)) ) )
|
|
|
|
LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l,
|
|
unsigned int seed, size_t step);
|
|
LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts);
|
|
LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b);
|
|
LUAI_FUNC int luaS_eqshrstr (TString *a, TString *b);
|
|
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
|
|
LUAI_FUNC void luaS_clearcache (global_State *g);
|
|
LUAI_FUNC void luaS_init (lua_State *L);
|
|
LUAI_FUNC void luaS_remove (lua_State *L, TString *ts);
|
|
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue);
|
|
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
|
|
LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
|
|
LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l);
|
|
LUAI_FUNC void luaS_share(TString *ts);
|
|
|
|
#endif
|