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

Function lua_pushlstring

third-party/lua-5.5.0/src/lapi.c:543–552  ·  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

541** 'memcmp' and 'memcpy'.
542*/
543LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) {
544 TString *ts;
545 lua_lock(L);
546 ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len);
547 setsvalue2s(L, L->top.p, ts);
548 api_incr_top(L);
549 luaC_checkGC(L);
550 lua_unlock(L);
551 return getstr(ts);
552}
553
554
555LUA_API const char *lua_pushexternalstring (lua_State *L,

Callers 9

pushlineFunction · 0.70
str_subFunction · 0.70
push_onecaptureFunction · 0.70
str_unpackFunction · 0.70
luaL_pushresultFunction · 0.70
luaopen_utf8Function · 0.70
loadfuncFunction · 0.70
searcher_CrootFunction · 0.70
db_getinfoFunction · 0.70

Calls 2

luaS_newFunction · 0.70
luaS_newlstrFunction · 0.70

Tested by

no test coverage detected