MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaS_newlstr

Function luaS_newlstr

third-party/lua-5.2.4/src/lstring.c:156–164  ·  view source on GitHub ↗

** new string (with explicit length) */

Source from the content-addressed store, hash-verified

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

Callers 9

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

Calls 3

internshrstrFunction · 0.70
luaM_toobigFunction · 0.70
createstrobjFunction · 0.70

Tested by

no test coverage detected