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

Function lua_pushlstring

third-party/lua-5.3.5/src/lapi.c:479–488  ·  view source on GitHub ↗

** Pushes on the stack a string with given length. Avoid using 's' when ** 'len' == 0 (as 's' can be NULL in that case), due to later use of ** 'memcmp' and 'memcpy'. */

Source from the content-addressed store, hash-verified

477** 'memcmp' and 'memcpy'.
478*/
479LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
480 TString *ts;
481 lua_lock(L);
482 ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len);
483 setsvalue2s(L, L->top, ts);
484 api_incr_top(L);
485 luaC_checkGC(L);
486 lua_unlock(L);
487 return getstr(ts);
488}
489
490
491LUA_API const char *lua_pushstring (lua_State *L, const char *s) {

Callers 12

pushlineFunction · 0.70
str_subFunction · 0.70
push_onecaptureFunction · 0.70
add_valueFunction · 0.70
str_unpackFunction · 0.70
luaL_pushresultFunction · 0.70
luaL_findtableFunction · 0.70
luaopen_utf8Function · 0.70
pushnexttemplateFunction · 0.70
loadfuncFunction · 0.70
searcher_CrootFunction · 0.70
modinitFunction · 0.70

Calls 2

luaS_newFunction · 0.70
luaS_newlstrFunction · 0.70

Tested by

no test coverage detected