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

Function loadStringN

extlibs/lua/src/lundump.c:110–124  ·  view source on GitHub ↗

** Load a nullable string. */

Source from the content-addressed store, hash-verified

108** Load a nullable string.
109*/
110static TString *loadStringN (LoadState *S) {
111 size_t size = loadSize(S);
112 if (size == 0)
113 return NULL;
114 else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */
115 char buff[LUAI_MAXSHORTLEN];
116 loadVector(S, buff, size);
117 return luaS_newlstr(S->L, buff, size);
118 }
119 else { /* long string */
120 TString *ts = luaS_createlngstrobj(S->L, size);
121 loadVector(S, getstr(ts), size); /* load directly in final place */
122 return ts;
123 }
124}
125
126
127/*

Callers 3

loadStringFunction · 0.85
loadDebugFunction · 0.85
loadFunctionFunction · 0.85

Calls 3

loadSizeFunction · 0.85
luaS_newlstrFunction · 0.85
luaS_createlngstrobjFunction · 0.85

Tested by

no test coverage detected