MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaS_newlstr

Function luaS_newlstr

freebsd/contrib/openzfs/module/lua/lstring.c:157–165  ·  view source on GitHub ↗

** new string (with explicit length) */

Source from the content-addressed store, hash-verified

155** new string (with explicit length)
156*/
157TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
158 if (l <= LUAI_MAXSHORTLEN) /* short string? */
159 return internshrstr(L, str, l);
160 else {
161 if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char))
162 luaM_toobig(L);
163 return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL);
164 }
165}
166
167
168/*

Callers 8

luaV_tostringFunction · 0.70
luaV_concatFunction · 0.70
luaX_newstringFunction · 0.70
pushstrFunction · 0.70
lua_pushlstringFunction · 0.70
lua_concatFunction · 0.70
luaK_numberKFunction · 0.70
luaS_newFunction · 0.70

Calls 3

internshrstrFunction · 0.85
createstrobjFunction · 0.85
luaM_toobigFunction · 0.70

Tested by

no test coverage detected