MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / pushstr

Function pushstr

extlibs/lua/src/lobject.c:393–402  ·  view source on GitHub ↗

** Push given string to the stack, as part of the buffer. If the stack ** is almost full, join all partial strings in the stack into one. */

Source from the content-addressed store, hash-verified

391** is almost full, join all partial strings in the stack into one.
392*/
393static void pushstr (BuffFS *buff, const char *str, size_t l) {
394 lua_State *L = buff->L;
395 setsvalue2s(L, L->top, luaS_newlstr(L, str, l));
396 L->top++; /* may use one extra slot */
397 buff->pushed++;
398 if (buff->pushed > 1 && L->top + 1 >= L->stack_last) {
399 luaV_concat(L, buff->pushed); /* join all partial results into one */
400 buff->pushed = 1;
401 }
402}
403
404
405/*

Callers 2

clearbuffFunction · 0.85
addstr2buffFunction · 0.85

Calls 2

luaS_newlstrFunction · 0.85
luaV_concatFunction · 0.85

Tested by

no test coverage detected